java-ANR输入超时

java-ANR输入超时,第1张

概述输入分派超时(等待,因为没有窗口具有焦点,但是有一个聚焦的应用程序可能会在启动完成时最终添加一个窗口.)嗨!我从几个用户那里得到了这个奇怪的ANR报告.不幸的是,我对ANR报告的了解非常有限,我希望有人可以帮助我了解造成这种情况的原因是"main"tid=1Waiting"main"prio=5t

输入分派超时(等待,因为没有窗口具有焦点,但是有一个聚焦的应用程序可能会在启动完成时最终添加一个窗口.)

嗨!我从几个用户那里得到了这个奇怪的ANR报告.不幸的是,我对ANR报告的了解非常有限,我希望有人可以帮助我了解造成这种情况的原因是

"main" tID=1 Waiting "main" prio=5 tID=1 Waiting| group="main" sCount=1 dsCount=0 flags=1 obj=0x733b6610 self=0x7b2cebea00| sysTID=5982 nice=-10 cgrp=default sched=0/0 handle=0x7bb1b3b9a8| state=S schedstat=( 895549085 117045629 1679 ) utm=75 stm=13 core=7 HZ=100  | stack=0x7fc1071000-0x7fc1073000 stackSize=8MB  | held mutexes=  at java.lang.Object.wait (Native method)- waiting on <0x06cee88a> (a java.lang.Object)  at java.lang.Thread.parkFor$(Thread.java:2137)- locked <0x06cee88a> (a java.lang.Object)  at sun.misc.Unsafe.park (Unsafe.java:358)  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:450)  at java.util.concurrent.FutureTask.get (FutureTask.java:192)  at androID.os.AsyncTask.get (AsyncTask.java:542)  at trai.gov.in.dnd.app.DNDMasteractivityNEW.forceUpdateAppDialog (DNDMasteractivityNEW.java:281)  at trai.gov.in.dnd.app.DNDMasteractivityNEW.Init (DNDMasteractivityNEW.java:272)  at trai.gov.in.dnd.app.DNDMasteractivityNEW.onCreate (DNDMasteractivityNEW.java:92)  at androID.app.Activity.performCreate (Activity.java:6999)  at androID.app.Activity.performCreate (Activity.java:6990)  at androID.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1214)  at androID.app.ActivityThread.performlaunchActivity (ActivityThread.java:2731)  at androID.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2856)  at androID.app.ActivityThread.-wrap11 (ActivityThread.java)  at androID.app.ActivityThread$H.handleMessage (ActivityThread.java:1589)  at androID.os.Handler.dispatchMessage (Handler.java:106)  at androID.os.Looper.loop (Looper.java:164)  at androID.app.ActivityThread.main (ActivityThread.java:6494)  at java.lang.reflect.Method.invoke (Native method)  at com.androID.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)  at com.androID.internal.os.ZygoteInit.main (ZygoteInit.java:807)"AsyncTask #1" tID=12 Native Performing network I/O"AsyncTask #1" prio=5 tID=12 Native  | group="main" sCount=1 dsCount=0 flags=1 obj=0x12dc0000 self=0x7b21fef800  | sysTID=6009 nice=10 cgrp=default sched=0/0 handle=0x7b176854f0  | state=S schedstat=( 226769531 4555214 150 ) utm=20 stm=1 core=7 HZ=100  | stack=0x7b17583000-0x7b17585000 stackSize=1037KB  | held mutexes=  #00  pc 000000000006a58c  /system/lib64/libc.so (__ppoll+8)  #01  pc 00000000000264c0  /system/lib64/libc.so (poll+88)  #02  pc 000000000002ea78  /system/lib64/libjavacore.so (???)  #03  pc 0000000000236ad0  /system/framework/arm64/boot-core-libart.oat (Java_libcore_io_linux_poll___3LandroID_system_StructPollfd_2I+160)  at libcore.io.linux.poll (Native method)  at libcore.io.BlockGuardOs.poll (BlockGuardOs.java:216)  at libcore.io.IoBrIDge.isConnected (IoBrIDge.java:254)  at libcore.io.IoBrIDge.connectErrno (IoBrIDge.java:188)  at libcore.io.IoBrIDge.connect (IoBrIDge.java:130)  at java.net.PlainSocketImpl.socketConnect (PlainSocketImpl.java:129)  at java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:356)- locked <0x0b28cfd7> (a java.net.socksSocketImpl)  at java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:200)  at java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:182)  at java.net.socksSocketImpl.connect (SocksSocketImpl.java:357)  at java.net.socket.connect (Socket.java:616)  at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket (PlainSocketFactory.java:124)  at org.apache.http.impl.conn.DefaultClIEntConnectionoperator.openConnection (DefaultClIEntConnectionoperator.java:149)  at org.apache.http.impl.conn.AbstractPoolEntry.open (AbstractPoolEntry.java:169)  at org.apache.http.impl.conn.AbstractPooledConnAdapter.open (AbstractPooledConnAdapter.java:124)  at org.apache.http.impl.clIEnt.DefaultRequestDirector.execute (DefaultRequestDirector.java:366)  at org.apache.http.impl.clIEnt.AbstracthttpClIEnt.execute (AbstracthttpClIEnt.java:560)  at org.apache.http.impl.clIEnt.AbstracthttpClIEnt.execute (AbstracthttpClIEnt.java:492)  at org.apache.http.impl.clIEnt.AbstracthttpClIEnt.execute (AbstracthttpClIEnt.java:470)  at trai.gov.in.dnd.extras.Network.httpCallToServer (Network.java:122)  at trai.gov.in.dnd.extras.AsyncNetworkWithID.doInBackground (AsyncNetworkWithID.java:32)  at trai.gov.in.dnd.extras.AsyncNetworkWithID.doInBackground (AsyncNetworkWithID.java:10)  at androID.os.AsyncTask.call (AsyncTask.java:333)  at java.util.concurrent.FutureTask.run (FutureTask.java:266)  at androID.os.AsyncTask$SerialExecutor.run (AsyncTask.java:245)  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)  at java.lang.Thread.run (Thread.java:764)

解决方法:

当在主(主)线程中进行长时间 *** 作时,会发生ANR.如果该线程繁忙,则AndroID无法在应用程序中处理任何进一步的GUI事件,从而引发ANR对话框.

显然,您的代码中的一部分正在占用大量资源或花费时间来完成.这就是使您的应用抛出ANR的原因.

检查您的DNDMasteractivityNEW.java类,是否有某些延迟您的输入的调度.有两种方法可以解决此问题:

>您可以使用进度条来指示调度正在进行的时间,完成时将可见性设置为“ GONE”.
>使用其他线程进行分派.
>寻找一种更省时的方法来替代当前用于分配输入的方法.

如果仍然无法解决问题,请发布您的DNDMasteractivityNEW.java代码.

总结

以上是内存溢出为你收集整理的java-ANR输入超时全部内容,希望文章能够帮你解决java-ANR输入超时所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1080797.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存