我想在我的Android应用中集成Google plus并将我的应用中的帖子分享给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
类被弃用了。所以,我的问题是,是否有其他方法或其他方式在Google Plus上分享帖子?
注意:从我的应用程序共享帖子工作正常。
我找到了另一种方法。这是以下面的方式。
Intent shareIntent = ShareCompat.IntentBuilder.from(this)
.setText("your Text")
.setType("text/plain")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivityForResult(shareIntent, GOOGLE_REQUEST_SHARE);