android - 如何在android中显示所有共享选项?

标签 android share

我正在开发一个 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/

相关文章:

Facebook sharer.php 忽略图像

php - 错误: The terms you entered did not bring any results with twitter share on mobile only

android - 为 Actionbar SearchView 创建异步 ContentProvider

Android - 使用 picasso 加载图像而不将其存储在缓存中

Android- ScrollView 和水平回收 View 之间的滑动冲突

facebook - 为什么 facebook 的 dialog.feed 需要一个 app_id

package - 如何在不共享源代码的情况下分发 ROS 包

从非 flavor 应用程序引用的 Android 多 flavor 库 - AAPT : No resource found

java - NSData 是什么意思?如何在java中实现其特性?

windows - 如何创建可快速分发到本地计算机的可定制环境?