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 に答える