我正在开发一个 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"));
并在明显的
<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
而是使用
sharingIntent.setType("text/plain");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)