ShareActionProvider ( support.v7
) を使用してアプリの共有を実行しようとしています。Gmail、Evernote などのすべてのアプリ。アル、うまく動作します-Facebookを除く。何が問題なのかわからない。ここに私のコードスニペットがあります:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.share, menu);
MenuItem shareItem = menu.findItem(R.id.action_share);
mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareItem);
mShareActionProvider.setShareIntent(shareIntent());
return true;
}
public Intent shareIntent () {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("type/plain");
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_SUBJECT,"SUBJECT");
shareIntent.putExtra(Intent.EXTRA_TEXT,"TEXT TEXT");
return shareIntent;
}