我需要Google+中的分享链接。在文档中,我看到了以下代码:在Google+上分享
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);
}
});
但是,如果在我的手机上是官方客户端Google+,它将起作用。我可以在Google+中分享链接,而无需使用官方客户端。
是的,但你必须有谷歌+ API。 – Gorets 2012-08-09 11:54:45
我没有找到它是怎么回事的:(。 – Vladimir 2012-08-09 11:56:57
http://code.google.com/p/google-api-java-client/wiki/APIs#Google+_API – Gorets 2012-08-09 12:00:42