当我使用Android代码发送短信时,它会在同一设备上返回RESULT_ERROR_GENERIC_FAILURE(三星s7562)
String phoneNumber = "889999999";
String message = "MBL A2Z" ;
SmsManager sms=SmsManager.getDefault();
PendingIntent piSent=PendingIntent.getBroadcast(Mobile_recharge.this, 0, new Intent("SMS_SENT"), 0);
PendingIntent piDelivered=PendingIntent.getBroadcast(Mobile_recharge.this, 0, new
Intent("SMS_DELIVERED"), 0);
sms.sendTextMessage(phoneNumber, null, message, piSent, piDelivered);
在samsung s7562上运行上面的代码,它给我RESULT_ERROR_GENERIC_FAILURE
错误。
答案 0 :(得分:0)
检查你是否完成了这些:
import android.telephony.SmsManager;
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNo, null, sms, null, null);
将此权限设置为manifest:
<uses-permission android:name="android.permission.SEND_SMS" />