调用发送短信程序的Uri

来源:互联网 发布:mac high sierra 升级 编辑:程序博客网 时间:2024/05/23 19:27
Uri smsToUri = Uri.parse("smsto:" + mContact.getNumber());
Intent intent = new Intent(Intent.ACTION_SENDTO, smsToUri);
intent.putExtra("sms_body", "The SMS text"); 

mContext.startActivity(intent);



或者:

Uri smsToUri = Uri.fromParts("smsto", mContact.getNumber(), null);
Intent intent = new Intent(Intent.ACTION_SENDTO, smsToUri);
intent.putExtra("sms_body", "The SMS text"); 
startActivity(intent);

原创粉丝点击