如何显示在Android的所有股票期权? [英] How to show all share options in android?

查看:125
本文介绍了如何显示在Android的所有股票期权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Android应用程序,并希望通过打开所有的结果分享一些文字
在设备可用的股权。但目前该列表显示电子邮件,蓝牙,Gmail和短信。

像BBC新闻其他应用都出现在诸如凹凸,Picasa和别人相同的设备更多的选择。如何显示所有可用的选项和处理?

我使用这样的:

 意图sharingIntent =新意图(android.content.Intent.ACTION_SEND);
sharingIntent.setType(文/电子名片);
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT,mailBody);
startActivity(Intent.createChooser(sharingIntent,共享使用));

在清单

 <意向滤光器>
  <作用机器人:名字=android.intent.action.SEND/>
  <类机器人:名字=android.intent.category.DEFAULT/>
  <数据机器人:mime类型=text / plain的/>
  &所述; /意图滤光器>


解决方案

这是因为你只显示登记处理意图文本/名片而是使用

  sharingIntent.setType(text / plain的);

I am developing an Android app and want to share some text by opening all the
share options available in device. But currently the list is showing Email, bluetooth, Gmail and messaging.

Other apps like BBC news are showing more options in the same device like Bump, Picasa, and others. How to show all available options and handle them?

I am using this:

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"));   

and in manifest

 <intent-filter>
  <action android:name="android.intent.action.SEND" />
  <category android:name="android.intent.category.DEFAULT" />
  <data android:mimeType="text/plain"/>
  </intent-filter>

解决方案

It is because you're only showing intents registered to handle text/vcard Instead use

sharingIntent.setType("text/plain");

这篇关于如何显示在Android的所有股票期权?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆