2011-11-10 47 views
5

我得到了開發者控制檯,指出我的應用程序已經凍結,因爲這個消息:意向ANR錯誤 - 屏幕關閉 - 我該如何處理它們?

ANR廣播{行動= android.intent.action.SCREEN_OFF FLG = 0x40000000之後}

有沒有堆棧跟蹤因爲這是由Froyo之前的用戶提出的。它甚至不會告訴我我的應用程序中的哪個活動導致了錯誤 - 儘管我猜測這是我的遊戲活動。

這也符合我自己的經驗,有時當我的手機電池電量不足時,我的應用程序將凍結並且必須被殺死。

在我的活動中,我應該做些什麼來處理這種凍結狀態?

我現在已經從市場獲得了一些正確的輸出,但我仍然不知道該如何處理它。 •於輸入事件無響應(例如按鍵,觸摸屏)在5秒鐘內:

DALVIK THREADS: 
"main" prio=5 tid=1 NATIVE 
    | group="main" sCount=1 dsCount=0 obj=0x400227b0 self=0xce98 
    | sysTid=4060 nice=0 sched=0/0 cgrp=default handle=-1345013476 
    | schedstat=(72099976000 6131816000 28732) 
    at android.media.SoundPool.play(Native Method) 
    at com.bazsoft.yaniv.SoundManager.playSound(SoundManager.java:88) 
    at com.bazsoft.yaniv.YanivGameActivity.displayPileCards(YanivGameActivity.java:675) 
    at com.bazsoft.yaniv.YanivGameActivity.access$22(YanivGameActivity.java:659) 
    at com.bazsoft.yaniv.YanivGameActivity$1.run(YanivGameActivity.java:628) 
    at android.app.Activity.runOnUiThread(Activity.java:3713) 
    at com.bazsoft.yaniv.YanivGameActivity.displayCards(YanivGameActivity.java:615) 
    at com.bazsoft.yaniv.YanivGameActivity.access$6(YanivGameActivity.java:614) 
    at com.bazsoft.yaniv.YanivGameActivity$ComputerHandler.handleMessage(YanivGameActivity.java:121) 
    at android.os.Handler.dispatchMessage(Handler.java:99) 
    at android.os.Looper.loop(Looper.java:143) 
    at android.app.ActivityThread.main(ActivityThread.java:4701) 
    at java.lang.reflect.Method.invokeNative(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:521) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:617) 
    at dalvik.system.NativeStart.main(Native Method) 

"AsyncTask #5" prio=5 tid=19 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x464cbd98 self=0x47f208 
    | sysTid=4877 nice=10 sched=0/0 cgrp=default handle=4216856 
    | schedstat=(13501000 72691000 93) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x4648bbd0> (a java.lang.VMThread) 
    at java.lang.Thread.parkFor(Thread.java:1535) 
    at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48) 
    at sun.misc.Unsafe.park(Unsafe.java:317) 
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131) 
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996) 
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 
    at java.lang.Thread.run(Thread.java:1096) 

"AsyncTask #4" prio=5 tid=22 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x465379d8 self=0x460698 
    | sysTid=4796 nice=10 sched=0/0 cgrp=default handle=4864896 
    | schedstat=(14816000 60081000 94) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x46491a40> (a java.lang.VMThread) 
    at java.lang.Thread.parkFor(Thread.java:1535) 
    at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48) 
    at sun.misc.Unsafe.park(Unsafe.java:317) 
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131) 
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996) 
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 
    at java.lang.Thread.run(Thread.java:1096) 

"AsyncTask #3" prio=5 tid=21 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x46558de8 self=0x44f1a8 
    | sysTid=4759 nice=10 sched=0/0 cgrp=default handle=4865256 
    | schedstat=(17781000 122763000 125) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x46545340> (a java.lang.VMThread) 
    at java.lang.Thread.parkFor(Thread.java:1535) 
    at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48) 
    at sun.misc.Unsafe.park(Unsafe.java:317) 
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131) 
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996) 
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 
    at java.lang.Thread.run(Thread.java:1096) 

"Binder Thread #3" prio=5 tid=20 NATIVE 
    | group="main" sCount=1 dsCount=0 obj=0x463e9610 self=0x4958e8 
    | sysTid=4750 nice=0 sched=0/0 cgrp=default handle=4807336 
    | schedstat=(8851000 15266000 40) 
    at dalvik.system.NativeStart.run(Native Method) 

"AsyncTask #2" prio=5 tid=18 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x464423c8 self=0x48dad8 
    | sysTid=4737 nice=10 sched=0/0 cgrp=default handle=3804272 
    | schedstat=(14045000 80530000 96) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x464c2db8> (a java.lang.VMThread) 
    at java.lang.Thread.parkFor(Thread.java:1535) 
    at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48) 
    at sun.misc.Unsafe.park(Unsafe.java:317) 
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131) 
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996) 
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 
    at java.lang.Thread.run(Thread.java:1096) 

"AsyncTask #1" prio=5 tid=8 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x464dfed8 self=0x41b5e8 
    | sysTid=4550 nice=10 sched=0/0 cgrp=default handle=3585048 
    | schedstat=(12129000 58868000 77) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x464eefa0> (a java.lang.VMThread) 
    at java.lang.Thread.parkFor(Thread.java:1535) 
    at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48) 
    at sun.misc.Unsafe.park(Unsafe.java:317) 
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131) 
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996) 
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 
    at java.lang.Thread.run(Thread.java:1096) 

"WebViewWorkerThread" prio=5 tid=17 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x4644d988 self=0x32d200 
    | sysTid=4099 nice=1 sched=0/0 cgrp=default handle=3330880 
    | schedstat=(74615000 42294000 225) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x4644dbc8> (a android.os.MessageQueue) 
    at java.lang.Object.wait(Object.java:288) 
    at android.os.MessageQueue.next(MessageQueue.java:146) 
    at android.os.Looper.loop(Looper.java:123) 
    at android.os.HandlerThread.run(HandlerThread.java:60) 

"http3" prio=5 tid=16 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x46438aa8 self=0x32c618 
    | sysTid=4098 nice=1 sched=0/0 cgrp=default handle=3327832 
    | schedstat=(9630000 2435000 22) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x46437ce8> (a android.net.http.RequestQueue) 
    at java.lang.Object.wait(Object.java:288) 
    at android.net.http.ConnectionThread.run(ConnectionThread.java:98) 

"http2" prio=5 tid=15 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x464388b8 self=0x32bbd0 
    | sysTid=4097 nice=1 sched=0/0 cgrp=default handle=3325200 
    | schedstat=(6453000 547000 21) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x46437ce8> (a android.net.http.RequestQueue) 
    at java.lang.Object.wait(Object.java:288) 
    at android.net.http.ConnectionThread.run(ConnectionThread.java:98) 

"http1" prio=5 tid=14 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x464386c8 self=0x32afb0 
    | sysTid=4095 nice=1 sched=0/0 cgrp=default handle=3322096 
    | schedstat=(14060000 4044000 35) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x46437ce8> (a android.net.http.RequestQueue) 
    at java.lang.Object.wait(Object.java:288) 
    at android.net.http.ConnectionThread.run(ConnectionThread.java:98) 

"http0" prio=5 tid=11 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x464384d8 self=0x31b898 
    | sysTid=4094 nice=1 sched=0/0 cgrp=default handle=3263064 
    | schedstat=(10561000 11218000 28) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x46437ce8> (a android.net.http.RequestQueue) 
    at java.lang.Object.wait(Object.java:288) 
    at android.net.http.ConnectionThread.run(ConnectionThread.java:98) 

"SoundPool" prio=5 tid=13 NATIVE 
    | group="main" sCount=1 dsCount=0 obj=0x464237e0 self=0x2e4a08 
    | sysTid=4077 nice=0 sched=0/0 cgrp=default handle=2519808 
    | schedstat=(236000 6104000 5) 
    at dalvik.system.NativeStart.run(Native Method) 

"SoundPoolThread" prio=5 tid=12 NATIVE 
    | group="main" sCount=1 dsCount=0 obj=0x46418800 self=0x2def70 
    | sysTid=4078 nice=0 sched=0/0 cgrp=default handle=2520264 
    | schedstat=(4442000 4642000 55) 
    at dalvik.system.NativeStart.run(Native Method) 

"pool-1-thread-1" prio=5 tid=10 WAIT 
    | group="main" sCount=1 dsCount=0 obj=0x463f2218 self=0x2ca760 
    | sysTid=4075 nice=0 sched=0/0 cgrp=default handle=2878472 
    | schedstat=(86256000 83712000 143) 
    at java.lang.Object.wait(Native Method) 
    - waiting on <0x463f2488> (a java.lang.VMThread) 
    at java.lang.Thread.parkFor(Thread.java:1535) 
    at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48) 
    at sun.misc.Unsafe.park(Unsafe.java:317) 
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131) 
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996) 
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359) 
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001) 
    at java.uti... 
+0

您是否找到解決方案? – philipp

+1

我爲自己的遊戲收到了相同的輸出,我無法理解那裏的一件事。所以我選擇忽略它。把時間花在ANR錯誤上,如果過於頻繁,或者只是忽略它們。 – noob

+0

我在我的應用程序中找到了相同的ANR(一次)。我不使用BroadcastReceiver這個。 –

回答

2

,當它檢測到下列條件中的一個Android將顯示特定應用程序中的ANR對話框。 •10秒內BroadcastReceiver尚未完成執行。

+1

我沒有任何BroadcastReceivers定義,所以我不認爲這是。 –

+0

這個答案對於OP的問題是否正確? –