Java SMS意图不仅在oneplus手机中填充收件人
谷歌的策略更改为不使用发送短信后。我使用短信发送的目的与自定义信息和发件人地址自动填充短信。它几乎适用于所有移动设备。但只有在oneplus手机中,receipent地址才不会被填充 专用void发送短信(字符串电话号码、字符串消息){ 我也试过了Java SMS意图不仅在oneplus手机中填充收件人,java,android,Java,Android,谷歌的策略更改为不使用发送短信后。我使用短信发送的目的与自定义信息和发件人地址自动填充短信。它几乎适用于所有移动设备。但只有在oneplus手机中,receipent地址才不会被填充 专用void发送短信(字符串电话号码、字符串消息){ 我也试过了 Intent sendIntent =new Intent(Intent.ACTION_VIEW); sendIntent.setType("text/plain"); send
Intent sendIntent =new Intent(Intent.ACTION_VIEW);
sendIntent.setType("text/plain");
sendIntent.putExtra(Intent.EXTRA_TEXT, message);
sendIntent.putExtra("address",phoneNumber);
sendIntent.putExtra("exit_on_sent", true);
sendIntent.setData(Uri.parse("smsto:" + phoneNumber));
and
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.putExtra("address", phoneNumber);
intent.putExtra("sms_body", message);
intent.setData(Uri.parse("smsto:" + phoneNumber));
intent.putExtra("exit_on_sent", true);
在oneplus手机(3、7和7 pro)中没有一款可以使用。它在所有MI手机、三星、诺基亚、荣誉、摩托罗拉、联想等中都可以使用。只有oneplus手机有问题。
我已经尝试了下面的,它成功地为我工作。测试一加三T
String phoneNumber="+91xxxxxxxxxx";
String message ="Hi ABZ";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));
intent.putExtra("sms_body", message);
startActivity(intent);[![enter image description here][1]][1]
我也有同样的问题。你找到解决办法了吗?
String phoneNumber="+91xxxxxxxxxx";
String message ="Hi ABZ";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));
intent.putExtra("sms_body", message);
startActivity(intent);[![enter image description here][1]][1]