PlusShare class 已弃用。 android 应用程序中的 google Plus 是否有其他替代方案可以分享?
PlusShare class is deprecated. Is there any other alternative to share on google Plus from android app?
我想将 Google plus 集成到我的 android 应用程序中,并将我的应用程序中的 post 共享到 Google Plus。为此,我正在关注它的documentation。在该文档中,提供了以下代码以在 google 上共享 plus :
Intent shareIntent = new PlusShare.Builder(this)
.setType("text/plain")
.setText("Welcome to the Google+ platform.")
.setContentUrl(Uri.parse("https://developers.google.com/+/"))
.getIntent();
startActivityForResult(shareIntent, 0);
但是,问题是 PlusShare
class 已弃用。所以,我的问题是,是否有任何其他方法或其他方式可以在 Google Plus 上共享 post?
Note: Sharing post from my app is working perfectly.
我找到了另一种方法。
也就是下面的方式。
Intent shareIntent = ShareCompat.IntentBuilder.from(this)
.setText("your Text")
.setType("text/plain")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivityForResult(shareIntent, GOOGLE_REQUEST_SHARE);
我想将 Google plus 集成到我的 android 应用程序中,并将我的应用程序中的 post 共享到 Google Plus。为此,我正在关注它的documentation。在该文档中,提供了以下代码以在 google 上共享 plus :
Intent shareIntent = new PlusShare.Builder(this)
.setType("text/plain")
.setText("Welcome to the Google+ platform.")
.setContentUrl(Uri.parse("https://developers.google.com/+/"))
.getIntent();
startActivityForResult(shareIntent, 0);
但是,问题是 PlusShare
class 已弃用。所以,我的问题是,是否有任何其他方法或其他方式可以在 Google Plus 上共享 post?
Note: Sharing post from my app is working perfectly.
我找到了另一种方法。 也就是下面的方式。
Intent shareIntent = ShareCompat.IntentBuilder.from(this)
.setText("your Text")
.setType("text/plain")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivityForResult(shareIntent, GOOGLE_REQUEST_SHARE);