问题
I need share link in Google+ from Android app. In documentation I saw this code:
Button shareButton = (Button) findViewById(R.id.share_button);
shareButton.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
// Launch the Google+ share dialog with attribution.
Intent shareIntent = ShareCompat.IntentBuilder.from(ExampleActivity.this)
.setType("text/plain")
.setText("Welcome to the Google+ platform. https://developers.google.com/+")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivity(shareIntent);
}
});
But it will work if on my phone is official client Google+. Can I share link in Google+ without to use official client.
回答1:
Google+ API doesn't support share. Link: https://developers.google.com/apis-explorer/#s/plus/v1/
回答2:
The Share Intent, shown in the code you've provided. uses the native Google+ application to share content to Google+. This is the only way to share content to Google+ on Android.
来源:https://stackoverflow.com/questions/11882775/share-in-google