smsManager.sendTextMessage is not working

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

    This is what works for me:

    PendingIntent pi = PendingIntent.getActivity(this, 0,
            new Intent(this, Next.class), 0); 
    //Next is the class to move when message sent
    SmsManager sms = SmsManager.getDefault();
    sms.sendTextMessage("phno", null, "message", null, null);
    

提交回复
热议问题