Android通过intent.createChooser发送短信

Android通过intent.createChooser发送短信,android,Android,这是我如何让用户发送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); 这

这是我如何让用户发送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);

这将列出许多应用程序的列表。我怎样才能让android只启动支持sms的应用程序呢?

这样创建您的意图:

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

好。这将打开一个文件浏览器和quickoffice:),而不是intent.setType(“text/plain”);解决方案是intent.setType(“vnd.android dir/mms-sms”);这是正确的。为了规范起见,我编辑了我的回复,将其包括在内。