我想要调用消息编写屏幕&从我的应用程序调用。我写了以下代码。请帮我进入消息编写屏幕..
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
switch (which) {
case 0:{
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + bean.getPhoneno()));
startActivity(callIntent);
}break;
case 1 :{
}break;
}
}
});enter code here
答案 0 :(得分:1)
试试这个,
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.putExtra("sms_body", "Content of the SMS goes here...");
sendIntent.setType("vnd.android-dir/mms-sms");
startActivity(sendIntent);
或
String number = "12345678";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null)));
答案 1 :(得分:1)
打开原生短信作曲家:
String number = "12346556"; // The number on which you want to send SMS
20
startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null)));
OR
Uri uri = Uri.parse("smsto:12346556");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", "Here you can set the SMS text to be sent");
startActivity(it);
更多信息:Sending SMS example。
答案 2 :(得分:0)
朋友我有更好的方法 -
Intent intent = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("sms", phone_number, null));
startActivity(intent);