LayoutManager-FlowLayout icon indicating copy to clipboard operation
LayoutManager-FlowLayout copied to clipboard

加载10000条数据

Open Allen-cxl opened this issue 6 years ago • 3 comments

加载10000条数据,App直接ANR了。有什么办法解决的吗?

Allen-cxl avatar Apr 18 '19 12:04 Allen-cxl

你把发生Anr的日志发给我

发自我的 iPhone

在 2019年4月18日,20:28,Allen-cxl [email protected] 写道:

加载10000条数据,App直接ANR了。有什么办法解决的吗?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

xiangcman avatar Apr 18 '19 16:04 xiangcman

后来我重新看了下,又没有出现anr。出现了下面问题: 1.空指针crash 2.上下快速滑动会卡顿,布局会重叠 java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Rect.bottom' on a null object reference at com.test.toastdemo.FlowLayoutManager.fill(FlowLayoutManager.java:191) at com.test.toastdemo.FlowLayoutManager.scrollVerticallyBy(FlowLayoutManager.java:241) at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4680)

代码片段: RecyclerView.setLayoutManager(new FlowLayoutManager()); RecyclerView.setAdapter(new RecycleViewAdapter(this, Data.foods())); public static List<Data> foods(){ List<Data> foods =new ArrayList<>(); Data food = null; for (int i = 0 ; i < 10000 ; i++){ food = new Data("recycle"+"("+i+")"); foods.add(food); } return foods; }

Allen-cxl avatar Apr 26 '19 02:04 Allen-cxl

具体加我qq吧 或者加群 1002326270

发自我的 iPhone

在 2019年4月26日,10:10,Allen-cxl [email protected] 写道:

后来我重新看了下,又没有出现anr。出现了下面问题: 1.空指针crash 2.上下快速滑动会卡顿,布局会重叠 java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Rect.bottom' on a null object reference at com.test.toastdemo.FlowLayoutManager.fill(FlowLayoutManager.java:191) at com.test.toastdemo.FlowLayoutManager.scrollVerticallyBy(FlowLayoutManager.java:241) at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4680)

代码片段: RecyclerView.setLayoutManager(new FlowLayoutManager()); RecyclerView.setAdapter(new RecycleViewAdapter(this, Data.foods())); public static List foods(){ List foods =new ArrayList<>(); Data food = null; for (int i = 0 ; i < 10000 ; i++){ food = new Data("recycle"+"("+i+")"); foods.add(food); } return foods; }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

xiangcman avatar Apr 29 '19 10:04 xiangcman