我正在从我的应用程序向使用 5 位数手机号码的服务器发送一条短信。
在 4.2.2 操作系统上,它会在下面弹出窗口询问我
Edited
问:如何处理取消/确定按钮?
这应该有效...
switch (getResultCode()) {
// if cancel pressed then result code is 5
case 5:
System.out.println("Message cancelled........");
break;
// else if send pressed then result code will be one of these below cases
case Activity.RESULT_OK:
break;
case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
break;
case SmsManager.RESULT_ERROR_NO_SERVICE:
break;
case SmsManager.RESULT_ERROR_NULL_PDU:
break;
case SmsManager.RESULT_ERROR_RADIO_OFF:
break;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)