<!--发送短信权限-->
<uses-permission android:name="android.permission.SEND_SMS"/>
String goNo=edtphone.getText().toString().trim();
String strContent=edtmess.getText().toString().trim();
SmsManager smsManager=SmsManager.getDefault();
PendingIntent sentIntent = PendingIntent.getBroadcast(SendMessageActivity.this, 0, new Intent(), 0);
//如果字数超过70,需拆分成多条短信发送
if (strContent.length() > 200) {
List<String> msgs = smsManager.divideMessage(strContent);
for (String msg : msgs) {
smsManager.sendTextMessage(goNo, null, msg, sentIntent, null);
}
} else {
smsManager.sendTextMessage(goNo, null, strContent, sentIntent, null);
}