如何通过广播接收器类发送短信 [英] How to send a sms message through broadcast receiver class

查看:94
本文介绍了如何通过广播接收器类发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

怎么了的家伙,
是否有可能创建一个发送短信同一类内的广播接收器一类?
请帮助。

Whats up guys, Is it possible to create a class that sends a text message inside 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);

因此​​,对于这个code你需要的上下文对象。

这篇关于如何通过广播接收器类发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆