java WARN/ActivityManager(78):启动超时已过期,放弃唤醒锁!-> 这是什么
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7489376/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WARN/ActivityManager(78): Launch timeout has expired, giving up wake lock! -> what is this
提问by Sli
As the title indicates i get this "error" when running my little app:
正如标题所示,我在运行我的小应用程序时遇到了这个“错误”:
WARN/ActivityManager(78): Launch timeout has expired, giving up wake lock!
It came after I added this line to my manifest file:
在我将这一行添加到我的清单文件之后,它出现了:
<uses-permission android:name="android.permission.INTERNET" />
The reason I added that line was to get my app the abillity to connect to a serversocket. Read on another forum that the line would solve my problem (not being able to connect). And well it might have but instead I get that other error.
我添加该行的原因是让我的应用程序能够连接到服务器套接字。在另一个论坛上阅读该线路将解决我的问题(无法连接)。好吧,它可能有,但我得到了另一个错误。
I'm totally new to android so don't understand much of that android specific stuff going on. Have some Java experience though.
我对android完全陌生,所以不太了解android特定的东西。不过有一些Java经验。
Any help appreciated (:
任何帮助表示赞赏(:
BTW: not sure if I should have posted some of my code?
顺便说一句:不确定我是否应该发布一些代码?
回答by Spidy
This error means your Activity is taking to long to start. If you are doing a lot of processing on the UI thread, Android kills your application. You should use AsyncTask for any processing intensive stuff.
此错误意味着您的 Activity 需要很长时间才能启动。如果您在 UI 线程上进行大量处理,Android 会杀死您的应用程序。您应该将 AsyncTask 用于任何处理密集型的东西。
If you could post your code and your SDK version, I can provide more help. There is also another thread on stackoverflow about this. Activity idle timeout for HistoryRecord?
如果您可以发布您的代码和您的 SDK 版本,我可以提供更多帮助。stackoverflow 上还有另一个关于此的线程。HistoryRecord 的活动空闲超时?
回答by Filippo Mazza
I had a similar problem retrieving a result from a php file in a server. I had solved putting php code inside <html>
tags. Without them the app was hanging there.
我在从服务器中的 php 文件中检索结果时遇到了类似的问题。我已经解决了将 php 代码放在<html>
标签中的问题。没有它们,应用程序就挂在那里。
Hope it helps
希望能帮助到你
回答by Marc Van Daele
I had a similar problem.
Inside my View.dispatchDraw(), I was calling a method that triggered another dispatchDraw().
(Adding a logline inside my dispatchDraw() showed that the function was called continuously.
This did not show up when doing method profiling in Eclipse)
我有一个类似的问题。
在我的 View.dispatchDraw() 中,我调用了一个触发另一个 dispatchDraw() 的方法。
(在我的 dispatchDraw() 中添加一个日志行显示该函数被连续调用。在 Eclipse 中进行方法分析时没有显示出来)
Hope this is helpful to someone.
希望这对某人有帮助。
回答by ivohad
Check if you don't have 2 or more Eclipse IDEs open (if that is your IDE of choice). It is possible that one of those is taken control over the parts of the ADB and refusing the others access. In my case, I experienced the same error, but when I closed every other Eclipse instance, the app started in debug mode immediately.
检查您是否没有打开 2 个或更多 Eclipse IDE(如果这是您选择的 IDE)。其中之一可能会控制亚行的部分内容并拒绝其他人的访问。就我而言,我遇到了同样的错误,但是当我关闭所有其他 Eclipse 实例时,应用程序立即以调试模式启动。