1. 调用系统发送短信界面(并指定短信接收人和短信内容)
Uri smsToUri = Uri.parse("smsto:10086");
Intent mIntent = new Intent( android.content.Intent.ACTION_SENDTO, smsToUri );
mIntent.putExtra("sms_body", "The SMS text");
startActivity( mIntent );
2. 调用系统已发送短信界面
Uri smsUri = Uri.parse("smsto:106900867734");
Intent intent = new Intent(Intent.ACTION_MAIN, smsUri)
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
这里我们使用action_main 根据api显示提示
android.content..ACTION_MAIN = "android.intent.action.MAIN"
public static finalACTION_MAINSince:
Activity Action: Start as a main entry point, does not expect to receive data.
Input: nothing
Output: nothing
Constant Value:"android.intent.action.MAIN"