开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜