我想打开本机应用程序发送短信,但应该已经有电话号码。我发现ACTION_SEND但是当我打电话给我的功能,它的回报错误:ACTION_SEND用于发送短信
04-26 11:59:15.991: ERROR/AndroidRuntime(20198): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SENDTO (has extras) }
我的代码这里介绍:
private void smsSend(String number) {
Intent intent = new Intent(Intent.ACTION_SENDTO, null);
intent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
startActivity(intent);
}
我知道这是很简单,但我不知道为什么它不工作,我找不到任何helfull信息。
感谢您的任何建议。
通过使用Uri和smsto问题解决了;) – Robert 2011-04-26 10:08:29
Uri uri = Uri.parse(“smsto:”);只打开邮件不会自动发送到任何数字 – 2016-05-23 23:59:44
OMG,这是相当多的necroposting,@mostafahashim – Lonkly 2016-05-24 13:52:34