java - Android send SMS from code -


this question has answer here:

in android there option make call code , there option move user caller app number , let him call himself. have code move user sms app content ready:

uri smsuri = uri.parse("sms:0542158081"); intent intent = new intent(intent.action_view, smsuri); intent.putextra("sms_body", text); startactivity(intent); 

but want send sms code phone call instead of waiting user. how can it?

user smsmanager so

smsmanager smsmanager = smsmanager.getdefault(); smsmanager.sendtextmessage("phonenumber", null, "sms message", null, null); 

Comments

Post a Comment

Popular posts from this blog

python - PyInstaller UAC not working in onefile mode -

python - RuntimeError: can't re-enter readline -

php - Need to store a large amount of data in session with CI 3 but on storing large data in session it is itself destorying automatically -