简体   繁体   English

在Android 2.3和Android 4.0中接收短信

[英]Receive SMS in Android 2.3 vs Android 4.0

I have written an SMS app to receive SMSes using the various samples available online. 我已经编写了一个SMS应用程序,以使用在线提供的各种示例来接收SMS。 I tested it in a Android 2.3 device and it was working perfectly. 我在Android 2.3设备上对其进行了测试,并且运行良好。

Now, I changed the API level to Android 4.0 and tried running it on an Android 4.0 device and nothing happens. 现在,我将API级别更改为Android 4.0,并尝试在Android 4.0设备上运行它,但没有任何反应。 I checked the logcat in Eclipse and nothing is displayed there too. 我在Eclipse中检查了logcat,那里也什么也不显示。

Any idea what needs to be done for it to work? 知道要做什么才能工作吗?

Thanks In Advance. 提前致谢。

Check Once Again that you are actually creating and registering the broadcast receiver in an Activity otherwise it will not get called as after Android 3.1 it requires apps to be in started state to receive broadcasts . 再次检查您实际上是在Activity中创建并注册广播接收器,否则它将不会像Android 3.1之后那样被调用, 它要求应用程序处于启动状态才能接收广播

Hope it will help. 希望它会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM