How post Image and Link URL in Google Plus from Android Application?

android, google-play-services, google-plus

Solution

You need `google-play-services_lib` library project. Just import it in workspace in add in your project.

You can find it at .../android-sdk-linux_x86/extras/google/google_play_services/libproject

And use this code for sharing on google-plus via google-plus application.

final int errorCode = GooglePlusUtil.checkGooglePlusApp(mActivity);
if (errorCode == GooglePlusUtil.SUCCESS) {
// Invoke the ACTION_SEND intent to share to Google+ with attribution.
Intent shareIntent = ShareCompat.IntentBuilder.from(mActivity)
                                .setText("")
                                .setType("text/plain")
                                .getIntent()
                                .setPackage("com.google.android.apps.plus");
    startActivity(shareIntent);
} else {
    Toast.makeText(mActivity, "Google plus not installed", Toast.LENGTH_LONG).show();
}

Problem

i have try to post Image from server and link URL both in google plus from android application.. but i can't post both in google plus.. i have try this code to post.. ``` Intent shareIntent = new PlusShare.Builder(GooglePlusActivity.this) .setType("text/plain") .setText("Welcome to the Google+ platform....") .setContentDeepLinkId("/cheesecake/lemon", "Lemon Cheesecake recipe", "A tasty recipe for making lemon cheesecake.", Uri.parse("http://www.onedigital.mx/ww3/wp-content/uploads/2012/02/android-420x315.jpg")) .setContentUrl(Uri.parse("https://developers.google.com/+/")) .getIntent();` ``` In tthis code i have only post a image but not post URL.. URl is display but it not clickable. some one give me solution for my problem..

Original source