Android 谷歌的份额+;
我需要从Android应用程序在Google+中共享链接。在文档中,我看到了以下代码:Android 谷歌的份额+;,android,google-plus,Android,Google Plus,我需要从Android应用程序在Google+中共享链接。在文档中,我看到了以下代码: Button shareButton = (Button) findViewById(R.id.share_button); shareButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Launch the Google+ share
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+中共享链接。Google+API不支持共享。链接:Google+API不支持共享。链接:共享意图,如您提供的代码所示。使用本机Google+应用程序将内容共享到Google+。这是在Android上向Google+共享内容的唯一方法。共享意图,如您提供的代码所示。使用本机Google+应用程序将内容共享到Google+。这是在Android上向Google+共享内容的唯一方法。是的,但是你必须拥有Google+api。是的,但是你必须拥有Google+api。