0

我使用此代码在 Twitter 上实现了发帖

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setClassName("com.twitter.android", "com.twitter.android.PostActivity");
        sharingIntent.putExtra(Intent.EXTRA_TEXT, msg);
        startActivity(sharingIntent);

现在我正在考虑为 Google+ 做同样的事情,但我找不到它的类/包。有谁知道它是哪一个或找到它的方法?谢谢!:)

4

1 回答 1

0

试试这个。

Intent shareIntent = ShareCompat.IntentBuilder.from(ShareActivity.this)
   .setText("This site has lots of great information about Android!
      http://www.android.com")
   .setType("text/plain")
   .getIntent()
   .setPackage("com.google.android.apps.plus");

startActivity(shareIntent);

在这里查看更多详情。

于 2012-09-06T13:10:53.547 回答