issue in sending sms using smsManager.sendTextManager on android

≡放荡痞女 提交于 2019-12-20 03:02:29

问题


i am sending an sms from my app to server which uses 5 digit mobile number.

on 4.2.2 os, it ask me below popup

Edited

Q. How to handle cancel/ok button?


回答1:


This should work...

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;
    }


来源:https://stackoverflow.com/questions/19402043/issue-in-sending-sms-using-smsmanager-sendtextmanager-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!