问题描述
即时启动我的应用程序时,有时有问题。不时屏幕一直是黑色,我必须等待10分钟。我没有得到一个错误消息,并且logcat中这样说:
i'm having sometimes problems when launching my app. From time to time the screen stays black and i have to wait 10 minutes. I don't get an error message and the logcat says this:
一十一月8号至10日:45:39.659:WARN / ActivityManager(104):启动超时已过期,放弃唤醒锁
一十一月8号至10日:45:39.736:WARN / ActivityManager(104):活动空闲超时时间为HistoryRecord {467060f0 org.ccast.contextproviders.androiddatacollector / .gui.UserInterfaceNew}
08-10 11:45:39.659: WARN/ActivityManager(104): Launch timeout has expired, giving up wake lock!
08-10 11:45:39.736: WARN/ActivityManager(104): Activity idle timeout for HistoryRecord{467060f0 org.ccast.contextproviders.androiddatacollector/.gui.UserInterfaceNew}
推荐答案
我想我找到了问题所在。我使用的服务和广播。一个服务发送一个广播到其他服务。该BroadcastReceiver的做一个长期的任务,其中包括一个HTTP连接。该广播有10秒的空闲超时,我的任务运行时间超过了10秒somtimes。所以应的BroadcastReceiver开始一个新的线程,以便它可以立即返回。
I think i found out what the problem is. I use services and broadcasts. One service sends a broadcast to another service. The BroadcastReceiver does a long task which includes a http connection. The Broadcast has an idle timeout of 10 secs and my task runs longer than 10 secs somtimes. So the BroadcastReceiver should start a new thread so that it can return immediately.
这篇关于活动空闲超时时间为HistoryRecord的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!