issue in sending sms using smsManager.sendTextManager on android

前端 未结 1 1749
夕颜
夕颜 2021-01-21 13: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 c

相关标签:
1条回答
  • 2021-01-21 14:08

    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;
        }
    
    0 讨论(0)
提交回复
热议问题