package com.neusoft.ls.smart.city.home.activity.govservice;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
public class CrashLinearLayoutManager extends LinearLayoutManager {
public CrashLinearLayoutManager(Context context) {
super(context);
}
public CrashLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public CrashLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
//java.lang.IndexOutOfBoundsException: Inconsistency detected
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
try {
super.onLayoutChildren( recycler, state );//下拉刷新的时候RecyclerView内部的错误,需要捕获一下防止崩溃
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
}