Android - Send SMS and make the text not editable

你离开我真会死。 提交于 2019-12-11 08:36:06

问题


                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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!