Send SMS between Android emulators

我是研究僧i 提交于 2019-12-03 13:30:48

I'm facing the same problem. It looks that it is a known bug, you can find it here: https://code.google.com/p/android/issues/detail?id=210767

Looks like they have solved it, and will add the fix on future versions.

Meanwhile I haven't found any way to solve it...

Write this code and run application in Emulator 5554.

PendingIntent pi;
SmsManager sms;
String msg = "android.telephony.SmsManager.STATUS_ON_ICC_SENT";
PendingIntent piSent = PendingIntent.getBroadcast(MainActivity.this, 0,new Intent(msg), 0);
sms = SmsManager.getDefault();
sms.sendTextMessage("5556", null, "This is sample test message", piSent, null);

Ugrading to the most recent Preview Android SDK Build Tools solves the problem.

Android SDK Tools 25.2.2 rc1

Be sure to enable "Preview Tools" in the settigns.

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