You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在 2019年4月18日,20:28,Allen-cxl ***@***.***> 写道:
加载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.
后来我重新看了下,又没有出现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;
}
在 2019年4月26日,10:10,Allen-cxl ***@***.***> 写道:
后来我重新看了下,又没有出现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.
Activity
xiangcman commentedon Apr 18, 2019
Allen-cxl commentedon Apr 26, 2019
后来我重新看了下,又没有出现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;
}
xiangcman commentedon Apr 29, 2019