smsManager.sendTextMessage is not working

后端 未结 4 2063
执笔经年
执笔经年 2020-12-09 12:50

I have the below event to send sms programatically. However is doens\'t seem to work, the toast pop up appears and there is no entry in logcat, just no message is created. I

4条回答
  •  时光取名叫无心
    2020-12-09 13:21

    Try this.

    SmsManager sms = SmsManager.getDefault();
    PendingIntent sentPI;
    String SENT = "SMS_SENT";
    
    sentPI = PendingIntent.getBroadcast(this, 0,new Intent(SENT), 0);
    
    sms.sendTextMessage(phoneNumber, null, message, sentPI, null);
    

提交回复
热议问题