无法从广播接收器取回数据
你好 , 我引用并将代码添加到 BroadcastReceiver 和 Activity 中,该代码在 此链接。
但我仍然无法将电话号码从广播接收器获取到另一个活动日志猫显示线路错误
String sms = intent.getExtras().getString("sms-text");
请给我正确的解决方案。帮助我。
HI ,
I refered and add the code into BroadcastReceiver and activity ,which is given in this link.
But still I am having problem in getting phone number from my broadcast receiver into another activity log cat shows error at line
String sms = intent.getExtras().getString("sms-text");
Plese give me right solution .help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您不仅从广播接收器启动活动,而且还手动启动两个活动。在这种情况下,意图中就没有额外的内容。只需添加空引用检查:
I assume you're starting the activity not only from broadcast receiver, but manually two. In that case there is no extra in the intent. Just add the null reference check: