@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 第一种去除标题 必需在setcontentview方法之前
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
// 开启一个子线程
new Thread(new Runnable() {
@Override
public 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();
发送短信
最新推荐文章于 2024-05-04 20:33:17 发布