SmsManager not working in Android 4.4.x

牧云@^-^@ 提交于 2019-12-10 23:16:49

问题


I am developing an Android app, which needs to send a message to multiple recipients.

I used this code to send an SMS to a phone:

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("9030500259", null, "sms message", null, null);

I have read many questions in this site which said the above is correct.

On Googling I found this:

http://android-developers.blogspot.in/2013/10/getting-your-sms-apps-ready-for-kitkat.html

According to the article in the above link, some changes happened in messaging.

I am unable to send SMS in my application. What is the correct code to send an SMS in Android version 4.4.x?


回答1:


i was facing same problem .but finally got solution . if u are testing this code in dual sim phone then sim slot 1 always keep active otherwise it " no service" error inn pendingsentintent.



来源:https://stackoverflow.com/questions/25049347/smsmanager-not-working-in-android-4-4-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!