我正在开发一个 Android 应用程序,想通过打开所有
来分享一些文本
设备中可用的共享选项。但目前该列表显示电子邮件、蓝牙、Gmail 和消息。
BBC 新闻等其他应用程序在 Bump、Picasa 等同一设备中显示更多选项。如何显示所有可用选项并处理它们?
我正在使用这个:
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/vcard");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT,mailBody);
startActivity(Intent.createChooser(sharingIntent,"Share using"));
并在 list 中
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain"/>
</intent-filter>
最佳答案
这是因为你只显示注册处理 text/vcard
的 Intent 而不是使用
sharingIntent.setType("text/plain");
关于android - 如何在android中显示所有共享选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11329851/