回答

3

这应该工作...

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