获取短信发送权限
<uses-permission android:name="android.permission.SEND_SMS"/>
发送
SmsManager sms=SmsManager.getDefault();
String desnum="手机号"
String str=“短信内容”
ArrayList <String> smsList=sms.divideMessage(str);
PendingIntent mPI = PendingIntent.getBroadcast(firstActivity.this,0,new Intent(),0);
ArrayList<PendingIntent> sentIntents = new ArrayList<PendingIntent>();
for (int i = 0; i < smsList.size(); i++)
{
sentIntents.add(mPI);
}
sms.sendMultipartTextMessage(desnum, null, smsList, sentIntents, null);
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END