我需要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