I\'m using a simple implementation of RecyclerView taken from the Android website using a StaggeredGridLayoutManager and I keep getting this error
this exception is not cause of
android:animateLayoutChanges
or
android:focusableInTouchMode
this final correct answer is just because you set a WRONG LayoutParams.
nameLP = new LinearLayout.LayoutParams(context.getResources().getDisplayMetrics().widthPixels, LinearLayout.LayoutParams.WRAP_CONTENT);
nameLP2 = new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT);
the nameLP is OK. the nameLP2 occur the crash .bug is here.
I try all of answers of this page. trust me.