-1
我有一些代碼從我的應用程序發送短信但是這個代碼只能發送160個字符,並不能發送超過160多這是我的代碼:如何在Android中發送超過160個字符的短信?
protected void sendMessage(String message){
String phoneNumber = "xxxx";
try {
if(message.length() < 161){
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNumber, null, message, null, null);
Toast.makeText(getApplicationContext(), "SMS Send !", Toast.LENGTH_LONG).show();
}else{
Toast.makeText(getApplicationContext(), "Character too long !", Toast.LENGTH_LONG).show();
}
}catch (Exception e){
Toast.makeText(getApplicationContext(), "SMS Failed !", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
如何與超過160個字符發送短信?