Android 不能';“不要从活动中发送短信,说”;“无法开始对话”;
这个代码正在工作,它打开默认的短信应用程序,短信出现在文本框中,准备输入号码并发送,但现在这个代码在棉花糖上面不起作用 但是现在如果默认应用程序是消息传递,它就不起作用了Android 不能';“不要从活动中发送短信,说”;“无法开始对话”;,android,android-intent,android-6.0-marshmallow,smsmanager,Android,Android Intent,Android 6.0 Marshmallow,Smsmanager,这个代码正在工作,它打开默认的短信应用程序,短信出现在文本框中,准备输入号码并发送,但现在这个代码在棉花糖上面不起作用 但是现在如果默认应用程序是消息传递,它就不起作用了 Uri uri = Uri.parse("smsto:" + mphoneno); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", message); mActivity.startActivity(it); 尝试以下方法打
Uri uri = Uri.parse("smsto:" + mphoneno);
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", message);
mActivity.startActivity(it);
尝试以下方法打开默认消息应用程序
public void sendSMS() {
String number = "12346556"; // The number on which you want to send SMS
startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null)));
}