How to send a sms message through broadcast receiver class
Whats up guys, Is it possible to create a class that sends a text message in开发者_运维技巧side the same class as the broadcast Receiver?? Please help.
Yes, to send the sms you just need the intent to send the sms like:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(“phonenumber”));
intent.putExtra(“sms_body”, body);
intent.putExtra(“compose_mode”, true);
context.startActivity(intent);
So for this code you need the Context
object.
精彩评论