操纵原生SMS应用程序

时间:2014-03-20 07:31:19

标签: android android-intent

我使用Intent之类的

在我的应用程序中发送短信
Intent si= new Intent(Intent.ACTION_VIEW);
si.putExtra("sms_body", "some text"); 
si.putExtra("address", "123456789"); 
si.setType("vnd.android-dir/mms-sms");
startActivity(si);

有没有办法可以限制用户添加任何其他文本,禁用本机应用程序的EditText区域,这是可能的......

1 个答案:

答案 0 :(得分:1)

而不是通过意图打开SMS APP为什么不使用SMS管理器(方法sendTextMessage)并从您的应用程序发送短信..

http://developer.android.com/reference/android/telephony/SmsManager.html

注意需要获得许可:http://developer.android.com/reference/android/Manifest.permission.html#SEND_SMS