我正在开发一个应用程序,我想在其中通过 facebook、twitter、gmail、消息或 share intent
提供的更多选项共享我的数据,只需转到此代码即可。 .
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE );
sharingIntent.setType("text/plain");
String shareBody = "Here is the share content body";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));
但这里的问题是,当我运行一个应用程序时,它只显示消息屏幕(其中 to
blah blah,键入撰写和发送按钮)我不能给我所有这些选项。所以请帮我解决这个...
最佳答案
如果您使用的是模拟器,这是因为消息是唯一安装的可以处理该类型共享的应用程序。您只能分享到已安装的应用程序,即,如果未安装 Twitter 客户端,则无法分享到 Twitter。
关于android - 分享意向不给我一个选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11220202/