发短信需要
的权限
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
String msg = msgText.getText().toString();
SmsManager smsManager = SmsManager.getDefault();
//短信是有字数限制,SmsManager已经封装了方法,过长,会自动分割
List<String> divideMsg = smsManager.divideMessage(msg);
for(String m : divideMsg){
smsManager.sendTextMessage(phoneEditText.getText().toString(),null , m,null,null);
}