如何监控我的应用程序的活动广播接收器?

发布于 2024-10-17 03:55:00 字数 291 浏览 5 评论 0原文

是否可以以某种方式查看特定的广播接收器是否已注册并正在运行?

我遇到了模拟器问题。我的代码在实际设备上运行良好,但在模拟器上运行不佳。我正在添加接近警报,并且我有一个实现 broadcastReceiver 的类。我注册了接收器,但是当我在模拟器上运行它时没有任何反应(我传递了有效的位置坐标,该坐标应该被邻近广播接收器捕获)。

我认为 broadcastReceiver 对象可能正在被垃圾收集。不然我无法解释。

有什么想法为什么会发生这种情况吗?我该如何调试这个?

Is it possible to somehow see if a particular broadcastReceiver is registered and running?

I'm facing a problem with the emulator. My code works fine on an actual device but not on an emulator. I'm adding proximity alerts and I have a class that implements broadcastReceiver. I register the receiver, but nothing happens when I run it on the emulator (I'm passing in valid location coordinates which should get caught by the proximity broadcast receiver).

I'm thinking that the broadcastReceiver object might be getting garbage collected. Otherwise I can't explain it.

Any ideas why this is happening? How can I debug this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫﹏色ふ单纯 2024-10-24 03:55:00

修复了它......显然只需要勾选擦除用户数据......

Fixed it...Just needed to tick wipe user data apparently....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文