Android的由intent.createChooser发送短信 [英] Android send sms by intent.createChooser

查看:129
本文介绍了Android的由intent.createChooser发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这我怎么让用户发送短信:

This how I let the user send an sms:

Intent intentt = new Intent(Intent.ACTION_SEND);
intentt.setType("text/plain");
intentt.putExtra(Intent.EXTRA_TEXT, "");
intentt.putExtra("address", selecteditem_phone);
startActivityForResult(Intent.createChooser(intentt, ""), 0);

这带来了很多的应用程序列表。我怎么能告诉机器人弹出只有短信功能的应用?

This brings up a list of a lot of apps. How can I tell android to bring up only the sms capable apps?

推荐答案

创建你的意图是这样,而不是:

Create your intent like this instead:

Intent intentt = new Intent(Intent.ACTION_VIEW);         
intentt.setData(Uri.parse("sms:"));
intentt.setType("vnd.android-dir/mms-sms");
intentt.putExtra(Intent.EXTRA_TEXT, "");
intentt.putExtra("address", selecteditem_phone);
startActivityForResult(Intent.createChooser(intentt, ""), 0);

这篇关于Android的由intent.createChooser发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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