- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在产品中的应用程序中遇到 ANR 问题。我有 2 台正在测试的设备(htcm8 和三星 tab3),但我无法重现该问题。
我的应用程序有几个 fragment (~10),其中大部分执行异步任务,所以我怀疑某处有锁,但我不确定。我通过一次真正启动多个线程 (asynctask) 并让它们尽可能长时间地运行来进行测试,但我从未遇到过 ANR。
我的主要问题是 ANR 的堆栈跟踪真的很难阅读和理解(崩溃更容易:))。是否有一些指南从哪里开始。
我查看了 stackoverflow,其中有一些来自该领域的好东西,但我缺少关于我们应该寻找的东西的详细白皮书?由于我不执行调试(ANR 发生在远程站点),需要注意哪些事项?
https://developer.android.com/training/articles/perf-anr.html没用吗?
这是 GetInfoWan.java 的第 166 行:
ipwan = new GetIP_WAN().execute("127.0.0.1").get();
例如,下面是我的踪迹。看起来有很多 asyctasks 同时运行,但我找不到“等待锁定”。
Jul 26, 2:12 PM on app version 17
HTC ONE M8s (htc_m8qlul), 2048MB RAM, Android 6.0
Report 1 of 17
EXPAND ALL
"main" tid=1 Waiting
"main" prio=5 tid=1 Waiting
| group="main" sCount=1 dsCount=0 obj=0x759befa8 self=0x55a086a060
| sysTid=21078 nice=-4 cgrp=default sched=0/0 handle=0x7fa9628fe8
| state=S schedstat=( 0 0 0 ) utm=638 stm=79 core=3 HZ=100
| stack=0x7fc6afc000-0x7fc6afe000 stackSize=8MB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x0010824c> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:1220)
- locked <0x0010824c> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:421)
at java.util.concurrent.FutureTask.get (FutureTask.java:163)
at android.os.AsyncTask.get (AsyncTask.java:498)
at com.bernard_zelmans.checksecurityPremium.Connectivity.GetInfoWan.getWanIpAddress (GetInfoWan.java:166)
at com.bernard_zelmans.checksecurityPremium.Discovery.DiscoverFragment.onActivityCreated (DiscoverFragment.java:187)
at android.app.Fragment.performActivityCreated (Fragment.java:2246)
at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:996)
at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1152)
at android.app.BackStackRecord.run (BackStackRecord.java:793)
at android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:1539)
at android.app.FragmentManagerImpl$1.run (FragmentManager.java:482)
at android.os.Handler.handleCallback (Handler.java:739)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:168)
at android.app.ActivityThread.main (ActivityThread.java:5885)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:687)
"FinalizerWatchdogDaemon" tid=4 Waiting
"FinalizerWatchdogDaemon" daemon prio=5 tid=4 Waiting
| group="system" sCount=1 dsCount=0 obj=0x12d3ebe0 self=0x55a0dc6f60
| sysTid=21087 nice=0 cgrp=default sched=0/0 handle=0x7fa51d4450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7fa50d2000-0x7fa50d4000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x0182d295> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Daemons$FinalizerWatchdogDaemon.waitForObject (Daemons.java:270)
- locked <0x0182d295> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Daemons$FinalizerWatchdogDaemon.run (Daemons.java:235)
at java.lang.Thread.run (Thread.java:818)
"FinalizerDaemon" tid=5 Waiting
"FinalizerDaemon" daemon prio=5 tid=5 Waiting
| group="system" sCount=1 dsCount=0 obj=0x12d3eb80 self=0x55a0dc6700
| sysTid=21086 nice=0 cgrp=default sched=0/0 handle=0x7fa52db450
| state=S schedstat=( 0 0 0 ) utm=0 stm=1 core=2 HZ=100
| stack=0x7fa51d9000-0x7fa51db000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x051b3faa> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait (Object.java:423)
at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:101)
- locked <0x051b3faa> (a java.lang.ref.ReferenceQueue)
at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:72)
at java.lang.Daemons$FinalizerDaemon.run (Daemons.java:193)
at java.lang.Thread.run (Thread.java:818)
"ReferenceQueueDaemon" tid=7 Waiting
"ReferenceQueueDaemon" daemon prio=5 tid=7 Waiting
| group="system" sCount=1 dsCount=0 obj=0x12d3eb20 self=0x55a0dc5ea0
| sysTid=21085 nice=0 cgrp=default sched=0/0 handle=0x7fa53e2450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7fa52e0000-0x7fa52e2000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x017c179b> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
at java.lang.Daemons$ReferenceQueueDaemon.run (Daemons.java:155)
- locked <0x017c179b> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
at java.lang.Thread.run (Thread.java:818)
"Binder_1" tid=8 Native
"Binder_1" prio=5 tid=8 Native
| group="main" sCount=1 dsCount=0 obj=0x12d590a0 self=0x55a0dc8020
| sysTid=21089 nice=0 cgrp=default sched=0/0 handle=0x7fa4db6450
| state=S schedstat=( 0 0 0 ) utm=2 stm=0 core=0 HZ=100
| stack=0x7fa4cba000-0x7fa4cbc000 stackSize=1013KB
| held mutexes=
native: pc 000000000006ac40 /system/lib64/libc.so (__ioctl+4)
native: pc 0000000000074c64 /system/lib64/libc.so (ioctl+100)
native: pc 000000000002d8fc /system/lib64/libbinder.so (_ZN7android14IPCThreadState14talkWithDriverEb+164)
native: pc 000000000002e1fc /system/lib64/libbinder.so (_ZN7android14IPCThreadState20getAndExecuteCommandEv+24)
native: pc 000000000002e328 /system/lib64/libbinder.so (_ZN7android14IPCThreadState14joinThreadPoolEb+92)
native: pc 0000000000037648 /system/lib64/libbinder.so (???)
native: pc 0000000000017b6c /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
native: pc 0000000000090910 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+140)
native: pc 0000000000017308 /system/lib64/libutils.so (???)
native: pc 00000000000686c4 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
native: pc 000000000001c7c4 /system/lib64/libc.so (__start_thread+16)
"Binder_2" tid=9 Native
"Binder_2" prio=5 tid=9 Native
| group="main" sCount=1 dsCount=0 obj=0x12d650a0 self=0x55a0dc8880
| sysTid=21090 nice=0 cgrp=default sched=0/0 handle=0x7fa4cb0450
| state=S schedstat=( 0 0 0 ) utm=2 stm=0 core=2 HZ=100
| stack=0x7fa4bb4000-0x7fa4bb6000 stackSize=1013KB
| held mutexes=
native: pc 000000000006ac40 /system/lib64/libc.so (__ioctl+4)
native: pc 0000000000074c64 /system/lib64/libc.so (ioctl+100)
native: pc 000000000002d8fc /system/lib64/libbinder.so (_ZN7android14IPCThreadState14talkWithDriverEb+164)
native: pc 000000000002e1fc /system/lib64/libbinder.so (_ZN7android14IPCThreadState20getAndExecuteCommandEv+24)
native: pc 000000000002e328 /system/lib64/libbinder.so (_ZN7android14IPCThreadState14joinThreadPoolEb+92)
native: pc 0000000000037648 /system/lib64/libbinder.so (???)
native: pc 0000000000017b6c /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
native: pc 0000000000090910 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+140)
native: pc 0000000000017308 /system/lib64/libutils.so (???)
native: pc 00000000000686c4 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
native: pc 000000000001c7c4 /system/lib64/libc.so (__start_thread+16)
"Thread-81073" tid=10 Native
"Thread-81073" prio=5 tid=10 Native
| group="main" sCount=1 dsCount=0 obj=0x12d6bb80 self=0x55a0dd4a60
| sysTid=21207 nice=0 cgrp=default sched=0/0 handle=0x7f9ff7f450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=1 HZ=100
| stack=0x7f9fe7d000-0x7f9fe7f000 stackSize=1037KB
| held mutexes=
native: pc 000000000006aaf0 /system/lib64/libc.so (__accept4+4)
native: pc 0000000000001044 /system/lib64/libnetd_client.so (???)
native: pc 000000000001bc7c /system/lib64/libc.so (accept4+16)
native: pc 00000000000d8d10 /system/lib64/libandroid_runtime.so (???)
native: pc 0000000000350c54 /system/framework/arm64/boot.oat (Java_android_net_LocalSocketImpl_accept__Ljava_io_FileDescriptor_2Landroid_net_LocalSocketImpl_2+184)
at android.net.LocalSocketImpl.accept (Native method)
at android.net.LocalSocketImpl.accept (LocalSocketImpl.java:331)
at android.net.LocalServerSocket.accept (LocalServerSocket.java:90)
at com.android.tools.fd.runtime.Server$SocketServerThread.run (Server.java:157)
at java.lang.Thread.run (Thread.java:818)
"RenderThread" tid=11 Native
"RenderThread" prio=5 tid=11 Native
| group="main" sCount=1 dsCount=0 obj=0x13ab00a0 self=0x55a0b12c90
| sysTid=21300 nice=-4 cgrp=default sched=0/0 handle=0x7f9fe15450
| state=S schedstat=( 0 0 0 ) utm=762 stm=242 core=0 HZ=100
| stack=0x7f9fd19000-0x7f9fd1b000 stackSize=1013KB
| held mutexes=
native: pc 000000000006ab54 /system/lib64/libc.so (__epoll_pwait+8)
native: pc 000000000001ce24 /system/lib64/libc.so (epoll_pwait+32)
native: pc 000000000001d560 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+144)
native: pc 000000000001d9c8 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+80)
native: pc 000000000002bc90 /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+100)
native: pc 0000000000017b6c /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
native: pc 0000000000090910 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+140)
native: pc 0000000000017308 /system/lib64/libutils.so (???)
native: pc 00000000000686c4 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
native: pc 000000000001c7c4 /system/lib64/libc.so (__start_thread+16)
"IntentService[ServiceSocket]" tid=12 Native
"IntentService[ServiceSocket]" prio=5 tid=12 Native
| group="main" sCount=1 dsCount=0 obj=0x13870f40 self=0x55a1066580
| sysTid=21301 nice=0 cgrp=default sched=0/0 handle=0x7f8e650450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=7 HZ=100
| stack=0x7f8e54e000-0x7f8e550000 stackSize=1037KB
| held mutexes=
native: pc 000000000006ab54 /system/lib64/libc.so (__epoll_pwait+8)
native: pc 000000000001ce24 /system/lib64/libc.so (epoll_pwait+32)
native: pc 000000000001d560 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+144)
native: pc 000000000001d9c8 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+80)
native: pc 00000000000d5180 /system/lib64/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+48)
native: pc 000000000000087c /system/framework/arm64/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+144)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:144)
at android.os.HandlerThread.run (HandlerThread.java:61)
"Thread-81076" tid=13 Native
"Thread-81076" prio=5 tid=13 Native
| group="main" sCount=1 dsCount=0 obj=0x1386da50 self=0x55a10675e0
| sysTid=21302 nice=0 cgrp=default sched=0/0 handle=0x7f8e54b450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=4 HZ=100
| stack=0x7f8e449000-0x7f8e44b000 stackSize=1037KB
| held mutexes=
native: pc 000000000006aaf0 /system/lib64/libc.so (__accept4+4)
native: pc 0000000000001044 /system/lib64/libnetd_client.so (???)
native: pc 000000000001bc7c /system/lib64/libc.so (accept4+16)
native: pc 0000000000039614 /system/lib64/libjavacore.so (???)
native: pc 0000000000350c54 /system/framework/arm64/boot.oat (Java_libcore_io_Posix_accept__Ljava_io_FileDescriptor_2Ljava_net_InetSocketAddress_2+184)
at libcore.io.Posix.accept (Native method)
at libcore.io.BlockGuardOs.accept (BlockGuardOs.java:63)
at java.net.PlainSocketImpl.accept (PlainSocketImpl.java:89)
at java.net.ServerSocket.implAccept (ServerSocket.java:217)
- locked <0x0c0b0311> (a java.net.ServerSocket)
at java.net.ServerSocket.accept (ServerSocket.java:141)
at com.bernard_zelmans.checksecurityPremium.ServiceSocket$ServerThread.run (ServiceSocket.java:58)
"PowerManagerThread" tid=14 Native
"PowerManagerThread" prio=5 tid=14 Native
| group="main" sCount=1 dsCount=0 obj=0x13abb7c0 self=0x55a0a4c880
| sysTid=21305 nice=0 cgrp=default sched=0/0 handle=0x7f8e446450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=1 HZ=100
| stack=0x7f8e344000-0x7f8e346000 stackSize=1037KB
| held mutexes=
native: pc 000000000006ab54 /system/lib64/libc.so (__epoll_pwait+8)
native: pc 000000000001ce24 /system/lib64/libc.so (epoll_pwait+32)
native: pc 000000000001d560 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+144)
native: pc 000000000001d9c8 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+80)
native: pc 00000000000d5180 /system/lib64/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+48)
native: pc 000000000000087c /system/framework/arm64/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+144)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:144)
at android.os.HandlerThread.run (HandlerThread.java:61)
"hwuiTask1" tid=15 Native
"hwuiTask1" prio=5 tid=15 Native
| group="main" sCount=1 dsCount=0 obj=0x13ae40a0 self=0x55a1237220
| sysTid=21321 nice=-2 cgrp=default sched=0/0 handle=0x7f8da7c450
| state=S schedstat=( 0 0 0 ) utm=56 stm=13 core=0 HZ=100
| stack=0x7f8d980000-0x7f8d982000 stackSize=1013KB
| held mutexes=
native: pc 0000000000019b40 /system/lib64/libc.so (syscall+28)
native: pc 00000000000683e4 /system/lib64/libc.so (_ZL33__pthread_cond_timedwait_relativeP23pthread_cond_internal_tP15pthread_mutex_tPK8timespec+96)
native: pc 000000000002ca68 /system/lib64/libhwui.so (???)
native: pc 0000000000017b6c /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
native: pc 0000000000090910 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+140)
native: pc 0000000000017308 /system/lib64/libutils.so (???)
native: pc 00000000000686c4 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
native: pc 000000000001c7c4 /system/lib64/libc.so (__start_thread+16)
"hwuiTask2" tid=16 Native
"hwuiTask2" prio=5 tid=16 Native
| group="main" sCount=1 dsCount=0 obj=0x13ae80a0 self=0x55a121fcd0
| sysTid=21322 nice=-2 cgrp=default sched=0/0 handle=0x7f8d976450
| state=S schedstat=( 0 0 0 ) utm=17 stm=5 core=3 HZ=100
| stack=0x7f8d87a000-0x7f8d87c000 stackSize=1013KB
| held mutexes=
native: pc 0000000000019b40 /system/lib64/libc.so (syscall+28)
native: pc 00000000000683e4 /system/lib64/libc.so (_ZL33__pthread_cond_timedwait_relativeP23pthread_cond_internal_tP15pthread_mutex_tPK8timespec+96)
native: pc 000000000002ca68 /system/lib64/libhwui.so (???)
native: pc 0000000000017b6c /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
native: pc 0000000000090910 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+140)
native: pc 0000000000017308 /system/lib64/libutils.so (???)
native: pc 00000000000686c4 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
native: pc 000000000001c7c4 /system/lib64/libc.so (__start_thread+16)
"AsyncTask #1" tid=17 Waiting
"AsyncTask #1" prio=5 tid=17 Waiting
| group="main" sCount=1 dsCount=0 obj=0x13b39a60 self=0x55a1381570
| sysTid=21495 nice=0 cgrp=default sched=0/0 handle=0x7f8be0b450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2 HZ=100
| stack=0x7f8bd09000-0x7f8bd0b000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x06fa9277> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:1220)
- locked <0x06fa9277> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2013)
at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1036)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
at java.lang.Thread.run (Thread.java:818)
"AsyncTask #2" tid=18 Waiting
"AsyncTask #2" prio=5 tid=18 Waiting
| group="main" sCount=1 dsCount=0 obj=0x13b39ac0 self=0x55a142c460
| sysTid=21497 nice=0 cgrp=default sched=0/0 handle=0x7f8bd06450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3 HZ=100
| stack=0x7f8bc04000-0x7f8bc06000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x005acee4> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:1220)
- locked <0x005acee4> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2013)
at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1036)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
at java.lang.Thread.run (Thread.java:818)
"AsyncTask #3" tid=19 Native
"AsyncTask #3" prio=5 tid=19 Native
| group="main" sCount=1 dsCount=0 obj=0x13b7c6a0 self=0x55a1533a00
| sysTid=21630 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x7f8b17f450
| state=S schedstat=( 0 0 0 ) utm=10 stm=4 core=0 HZ=100
| stack=0x7f8b07d000-0x7f8b07f000 stackSize=1037KB
| held mutexes=
native: pc 000000000006b618 /system/lib64/libc.so (read+4)
native: pc 000000000003798c /system/lib64/libjavacore.so (???)
native: pc 0000000000610b44 /system/framework/arm64/boot.oat (Java_libcore_io_Posix_readBytes__Ljava_io_FileDescriptor_2Ljava_lang_Object_2II+200)
at libcore.io.Posix.readBytes (Native method)
at libcore.io.Posix.read (Posix.java:169)
at libcore.io.BlockGuardOs.read (BlockGuardOs.java:230)
at libcore.io.IoBridge.read (IoBridge.java:468)
at java.io.FileInputStream.read (FileInputStream.java:177)
at java.io.InputStreamReader.read (InputStreamReader.java:233)
- locked <0x0a0bbf4d> (a java.lang.ProcessManager$ProcessInputStream)
at java.io.BufferedReader.fillBuf (BufferedReader.java:145)
at java.io.BufferedReader.readLine (BufferedReader.java:397)
- locked <0x0dd81a02> (a java.io.InputStreamReader)
at com.bernard_zelmans.checksecurityPremium.PingTest.PingTestFragment$Ping.doInBackground (PingTestFragment.java:393)
at com.bernard_zelmans.checksecurityPremium.PingTest.PingTestFragment$Ping.doInBackground (PingTestFragment.java:365)
at android.os.AsyncTask$2.call (AsyncTask.java:295)
at java.util.concurrent.FutureTask.run (FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run (AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
at java.lang.Thread.run (Thread.java:818)
"AsyncTask #8" tid=20 Waiting
"AsyncTask #8" prio=5 tid=20 Waiting
| group="main" sCount=1 dsCount=0 obj=0x13c5f820 self=0x55a15b1950
| sysTid=21803 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x7f8b075450
| state=S schedstat=( 0 0 0 ) utm=0 stm=1 core=1 HZ=100
| stack=0x7f8af73000-0x7f8af75000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x02bb596f> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:1220)
- locked <0x02bb596f> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2013)
at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1036)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
at java.lang.Thread.run (Thread.java:818)
"AsyncTask #4" tid=21 Waiting
"AsyncTask #4" prio=5 tid=21 Waiting
| group="main" sCount=1 dsCount=0 obj=0x13b7c760 self=0x55a1463bb0
| sysTid=21632 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x7f8af6b450
| state=S schedstat=( 0 0 0 ) utm=0 stm=1 core=3 HZ=100
| stack=0x7f8ae69000-0x7f8ae6b000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x0c7bdf13> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:1220)
- locked <0x0c7bdf13> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2013)
at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1036)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
at java.lang.Thread.run (Thread.java:818)
"WifiManager" tid=22 Native
"WifiManager" prio=5 tid=22 Native
| group="main" sCount=1 dsCount=0 obj=0x13b7c7c0 self=0x55a1422dc0
| sysTid=21639 nice=0 cgrp=default sched=0/0 handle=0x7f8ae61450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3 HZ=100
| stack=0x7f8ad5f000-0x7f8ad61000 stackSize=1037KB
| held mutexes=
native: pc 000000000006ab54 /system/lib64/libc.so (__epoll_pwait+8)
native: pc 000000000001ce24 /system/lib64/libc.so (epoll_pwait+32)
native: pc 000000000001d560 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+144)
native: pc 000000000001d9c8 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+80)
native: pc 00000000000d5180 /system/lib64/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+48)
native: pc 000000000000087c /system/framework/arm64/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+144)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:144)
at android.os.HandlerThread.run (HandlerThread.java:61)
"AsyncTask #5" tid=23 Waiting
"AsyncTask #5" prio=5 tid=23 Waiting
| group="main" sCount=1 dsCount=0 obj=0x13b7c8e0 self=0x55a142d880
| sysTid=21640 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x7f8ad55450
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2 HZ=100
| stack=0x7f8ac53000-0x7f8ac55000 stackSize=1037KB
| held mutexes=
at java.lang.Object.wait! (Native method)
- waiting on <0x0a67f550> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:1220)
- locked <0x0a67f550> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park
最佳答案
问题是 get() 方法,它将阻塞直到 AsyncTask 完成。 AsyncTasks 的线程池大小有限,因此如果有许多其他 AsyncTasks 正在进行,您将必须等待其他任务完成才能完成 GetIP_WAN AsyncTask。
您应该做的不是使用 get(),而是覆盖 AsyncTask 中的 onPostExecute 方法来获取结果。
关于android - 执行异步任务时出现ANR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45369575/
SQLite、Content provider 和 Shared Preference 之间的所有已知区别。 但我想知道什么时候需要根据情况使用 SQLite 或 Content Provider 或
警告:我正在使用一个我无法完全控制的后端,所以我正在努力解决 Backbone 中的一些注意事项,这些注意事项可能在其他地方更好地解决......不幸的是,我别无选择,只能在这里处理它们! 所以,我的
我一整天都在挣扎。我的预输入搜索表达式与远程 json 数据完美配合。但是当我尝试使用相同的 json 数据作为预取数据时,建议为空。点击第一个标志后,我收到预定义消息“无法找到任何内容...”,结果
我正在制作一个模拟 NHL 选秀彩票的程序,其中屏幕右侧应该有一个 JTextField,并且在左侧绘制弹跳的选秀球。我创建了一个名为 Ball 的类,它实现了 Runnable,并在我的主 Draf
这个问题已经有答案了: How can I calculate a time span in Java and format the output? (18 个回答) 已关闭 9 年前。 这是我的代码
我有一个 ASP.NET Web API 应用程序在我的本地 IIS 实例上运行。 Web 应用程序配置有 CORS。我调用的 Web API 方法类似于: [POST("/API/{foo}/{ba
我将用户输入的时间和日期作为: DatePicker dp = (DatePicker) findViewById(R.id.datePicker); TimePicker tp = (TimePic
放宽“邻居”的标准是否足够,或者是否有其他标准行动可以采取? 最佳答案 如果所有相邻解决方案都是 Tabu,则听起来您的 Tabu 列表的大小太长或您的释放策略太严格。一个好的 Tabu 列表长度是
我正在阅读来自 cppreference 的代码示例: #include #include #include #include template void print_queue(T& q)
我快疯了,我试图理解工具提示的行为,但没有成功。 1. 第一个问题是当我尝试通过插件(按钮 1)在点击事件中使用它时 -> 如果您转到 Fiddle,您会在“内容”内看到该函数' 每次点击都会调用该属
我在功能组件中有以下代码: const [ folder, setFolder ] = useState([]); const folderData = useContext(FolderContex
我在使用预签名网址和 AFNetworking 3.0 从 S3 获取图像时遇到问题。我可以使用 NSMutableURLRequest 和 NSURLSession 获取图像,但是当我使用 AFHT
我正在使用 Oracle ojdbc 12 和 Java 8 处理 Oracle UCP 管理器的问题。当 UCP 池启动失败时,我希望关闭它创建的连接。 当池初始化期间遇到 ORA-02391:超过
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 9 年前。 Improve
引用这个plunker: https://plnkr.co/edit/GWsbdDWVvBYNMqyxzlLY?p=preview 我在 styles.css 文件和 src/app.ts 文件中指定
为什么我的条形这么细?我尝试将宽度设置为 1,它们变得非常厚。我不知道还能尝试什么。默认厚度为 0.8,这是应该的样子吗? import matplotlib.pyplot as plt import
当我编写时,查询按预期执行: SELECT id, day2.count - day1.count AS diff FROM day1 NATURAL JOIN day2; 但我真正想要的是右连接。当
我有以下时间数据: 0 08/01/16 13:07:46,335437 1 18/02/16 08:40:40,565575 2 14/01/16 22:2
一些背景知识 -我的 NodeJS 服务器在端口 3001 上运行,我的 React 应用程序在端口 3000 上运行。我在 React 应用程序 package.json 中设置了一个代理来代理对端
我面临着一个愚蠢的问题。我试图在我的 Angular 应用程序中延迟加载我的图像,我已经尝试过这个2: 但是他们都设置了 src attr 而不是 data-src,我在这里遗漏了什么吗?保留 d
我是一名优秀的程序员,十分优秀!