开发者

How to send a sms message through broadcast receiver class

开发者 https://www.devze.com 2023-03-15 14:22 出处:网络
Whats up guys, Is it possible to create a class that sends a text message in开发者_运维技巧side the same class as the broadcast Receiver??

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消