WARN/ActivityManager(78): Launch timeout has expir

2019-01-15 18:01发布

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.

Any help appreciated (:

BTW: not sure if I should have posted some of my code?

4条回答
Rolldiameter
2楼-- · 2019-01-15 18:16

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.

Hope it helps

查看更多
太酷不给撩
3楼-- · 2019-01-15 18:26

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.

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?

查看更多
萌系小妹纸
4楼-- · 2019-01-15 18:26

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)

Hope this is helpful to someone.

查看更多
欢心
5楼-- · 2019-01-15 18:32

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.

查看更多
登录 后发表回答