ActivityManager 不断记录消息“启动活动,推迟广播意图”适用于带按钮的 Android Widget
我开发了一个主屏幕小部件。它有效,只是看起来没有反应。关于它此时没有响应的唯一线索是,每次我单击两个按钮之一时,它都会在 LogCat 中打印以下内容
:启动活动,推迟广播意图
我已经完成了谷歌调查,但目前还没有提出解决方案。我有一种潜伏的感觉,一旦我的活动在小部件上推进数据,它就会被杀死,并且必须再次重新实例化它才能回答意图。我不是每次都调用长时间运行的后台服务,我只是解析 String[] 中的下一个字符串并用其数据更新 RemoteViews。
我在这里做错了什么吗?
我应该做些什么不同的事情吗?
我是否迷失在 Android 小部件的荒原中?
任何帮助将不胜感激,谢谢!
I've got a homescreen widget that I've developed. It works, it just seems unresponsive. The only clue I've got as to why it's unresponsive at this point is that it prints the following in LogCat every time I click one of the two buttons:
ActivityManager | Launch activity, postpone broadcast intents
I've done my google diligence, but haven't come up with a solution at this point. I have a lurking feeling that my activity is being killed as soon as it advances the data on the widget, and it has to be re-instantiated again before it can answer the intent. I am NOT calling the long-running background service every time, I'm just parsing the next String in a String[] and updating the RemoteViews with its data.
Is there something I'm doing wrong here?
Is there something I should be doing differently?
Am I lost in the wasteland of android widgets?
Any help would be appreciated, Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,我在应该使用 ServiceIntents 的时候却使用了 BroadcastIntents。重写它以使用 Service 和 ServiceIntents 而不是 BroadcastIntents 和 Broadcast 接收器才能使其合理响应。
As it turns out, I was using BroadcastIntents when I should have been using ServiceIntents. Rewriting it to use a Service and ServiceIntents instead of BroadcastIntents and Broadcast receiver was what it took to get it to respond reasonably.