这是我用来调用 SMS 应用程序的一段代码:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uri));
intent.putExtra("sms_body", body);
intent.putExtra("compose_mode", true);
launchIntent(intent);
在 os 版本低于 Android 3.0 的设备上,上述代码运行正常,SMS 页面被打开并且要发送的消息和数字被正确预填,但在 Android 3.0 及更高版本的设备中,这不再工作了。
在 Android 3.0 中调用 SMS Intent 并填充数字而不是文本,而在 Android 4.0 中调用 SMS Intent 并填充文本而不是数字。
有谁知道这个问题的解决方案?