请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

老师,这个Anr是什么原因呀?

没有自己的代码,并且这个anr非常的频繁.老师能看一下吗?

at androidx.recyclerview.widget.AdapterHelper.findPositionOffset (AdapterHelper.java:472)
  at androidx.recyclerview.widget.AdapterHelper.canFindInPreLayout (AdapterHelper.java:422)
  at androidx.recyclerview.widget.AdapterHelper.applyUpdate (AdapterHelper.java:194)
  at androidx.recyclerview.widget.AdapterHelper.preProcess (AdapterHelper.java:105)
  at androidx.recyclerview.widget.RecyclerView.processAdapterUpdatesAndSetAnimationFlags (RecyclerView.java:3793)
  at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep1 (RecyclerView.java:4039)
  at androidx.recyclerview.widget.RecyclerView.dispatchLayout (RecyclerView.java:3849)
  at androidx.recyclerview.widget.RecyclerView.onLayout (RecyclerView.java:4404)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.RelativeLayout.onLayout (RelativeLayout.java:1103)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout (SwipeRefreshLayout.java:625)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.RelativeLayout.onLayout (RelativeLayout.java:1103)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at androidx.viewpager.widget.ViewPager.onLayout (ViewPager.java:1775)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.RelativeLayout.onLayout (RelativeLayout.java:1103)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at androidx.viewpager.widget.ViewPager.onLayout (ViewPager.java:1775)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.RelativeLayout.onLayout (RelativeLayout.java:1103)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at androidx.drawerlayout.widget.DrawerLayout.onLayout (DrawerLayout.java:1231)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:270)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1829)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1673)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1582)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:270)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1829)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1673)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1582)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:270)
  at com.android.internal.policy.DecorView.onLayout (DecorView.java:779)
  at android.view.View.layout (View.java:22084)
  at android.view.ViewGroup.layout (ViewGroup.java:6330)
  at android.view.ViewRootImpl.performLayout (ViewRootImpl.java:3209)
  at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2705)
  at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1791)
  at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:7867)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:967)
  at android.view.Choreographer.doCallbacks (Choreographer.java:791)
  at android.view.Choreographer.doFrame (Choreographer.java:726)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:952)
  at android.os.Handler.handleCallback (Handler.java:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7386)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:980)

正在回答 回答被采纳积分+3

2回答

提问者 TT2_X 2020-10-29 22:03:53

为什么又一个答案.

0 回复 有任何疑惑可以回复我~
  • 同学你好,回答没展示出来。
    
    单纯根据你贴出来的代码堆栈是没有办法判断及解决这个 ANR 的,可以在日志中搜索 ANR in 找系统的 Trace,那么比较详细。
    回复 有任何疑惑可以回复我~ 2020-10-30 18:04:46
随风绽放 2020-10-29 10:28:24

同学你好,单纯的这点日志是看不出来原因的。你在 Log 里面搜下 ANR in 。

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信