smsManager.sendTextMessage is not working

后端 未结 4 2062
执笔经年
执笔经年 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:14

    Actually this is working for me:

    String messageText = "...YOUR TEXT HERE...";
    SmsManager sm = SmsManager.getDefault();
    sm.sendTextMessage("PHONE NUMBER HERE", null, messageText, null, null);
    

    Just to be sure, with this you will not find the message sent in your message history.

提交回复
热议问题