问题
String number = "0707775544";
Uri uri = Uri.parse(number);
Intent smsIntent = new Intent(Intent.ACTION_SENDTO, uri);
smsIntent.putExtra("sms_body", "Hello world!");
startActivity(smsIntent);
When I run this code, Android's default SMS opens up and I can of course send this. My question is: is there anyway I can make the the text "Hello world!" NOT editable, and if you want to write a personal message, it gets below this "Hello world!".
Thanks in advance!
回答1:
If i got the question right, SmsManager is your solution. This tutorial might also be usefull.
回答2:
see this tutorial
http://android10.org/index.php/articlesfullapplications/241-sms-messaging-in-android-send-and-receive
you can customize the layout to disable the part you don't want changed then send the message directly
来源:https://stackoverflow.com/questions/7834134/android-send-sms-and-make-the-text-not-editable