从android中的广播接收器启动一个活动
我正在尝试从广播接收器启动主要活动。谁能指导我如何做到这一点?我总是收到“进程错误”的消息。
谢谢
I am trying to launch the Main Activity from a broadcast receiver. Can anyone guide me as to how I can do it? I always get "Process is Bad" message.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
重新启动模拟器或直接杀死进程即可解决这种情况。
Restart the emulator or just Kill the process that will solve this situation.
当使用真实设备时,我发现解决此问题的唯一方法是:
我的应用程序没有显示在设备上运行的进程列表中(它是一个 BroadcastReceiver),因此我无法终止该进程。
请参阅我的回答此处,了解有关无效内容的更多详细信息。
When using a real device, the only I found to fix this was:
My app didn't show up in the list of processes running on the device (it's a BroadcastReceiver), so I wasn't able to kill that process.
See my answer here for more detail on what didn't work.