分享在Google+中 [英] Share in Google+
本文介绍了分享在Google+中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从Android应用在Google+中分享链接。在文档中我看到这个code:
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);
}
});
如果在我的手机是官方的客户端Google+,但它会工作。我可以分享链接,在Google+中没有使用官方客户端。
But it will work if on my phone is official client Google+. Can I share link in Google+ without to use official client.
推荐答案
股份的意图,在$ C $所示的C您提供。使用本机应用程序Google+的分享内容至Google+。这是为了在Android上分享内容至Google+的唯一途径。
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.
这篇关于分享在Google+中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文