发送短信 SMS

//获得SmsManager对象

SmsManager smsManager = SmsManager.getDefault();

 

//构建PendingIntent对象并使用getBroadcast()广播

//将 PendingIntent,电话,短信文字等参数传入sendTextMessage()方法中发送短信

PendingIntent mPI = PendingIntent.getBroadcast( this, 0, new Intent(), 0);

 

smsManager.sendTextMessage(strDestAddress, null, strMessage, mPI, null);

 

发送短信的权限: 

<uses-permission android:name="android.permission.SEND_SMS"/>

你可能感兴趣的:(android,null,sms,电话)