发送短信

来源:互联网 发布:淘宝没有爱奇艺卖了 编辑:程序博客网 时间:2024/05/16 01:16
@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);// 第一种去除标题 必需在setcontentview方法之前requestWindowFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.activity_main);// 开启一个子线程new Thread(new Runnable() {@Overridepublic void run() {for (int i = 0; i < 10; i++) {SystemClock.sleep(1000);SmsManager man = SmsManager.getDefault();// 短信管理器man.sendTextMessage("15324720226",// 接受电话null, // 短信中心号码"短信内容"+i, null,// sentIntent 这里是发送成功就回调广播通知null// deliveryIntent 这是 当对面接受成功 回调此广播通知);}}}).start();

0 0