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
I've seen this crash a few times while using the navigation drawer.
java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:1462)
at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onItemRangeChanged(RecyclerView.java:3000)
at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyItemRangeChanged(RecyclerView.java:7503)
at android.support.v7.widget.RecyclerView$Adapter.notifyItemChanged(RecyclerView.java:4353)
at com.company.busscan.navigation.NavigationDrawerAdapter.touchPosition(NavigationDrawerAdapter.java:97)
at com.company.busscan.navigation.NavigationDrawerAdapter.access$000(NavigationDrawerAdapter.java:24)
at com.company.busscan.navigation.NavigationDrawerAdapter$1.onTouch(NavigationDrawerAdapter.java:64)
Trace mentions this chunk of code from NavigationDrawerAdapter:
private void touchPosition(int position) {
int lastPosition = mTouchedPosition;
mTouchedPosition = position;
if (lastPosition >= 0)
notifyItemChanged(lastPosition);
if (position >= 0)
notifyItemChanged(position);
}
and the ACTION_CANCEL case here too:
viewHolder.itemView.setOnTouchListener(
new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
touchPosition(i);
return false;
case MotionEvent.ACTION_CANCEL:
touchPosition(-1);
return false;
case MotionEvent.ACTION_MOVE:
return false;
case MotionEvent.ACTION_UP:
touchPosition(-1);
return false;
}
return true;
}
}
);
I've seen this crash a few times while using the navigation drawer.
Trace mentions this chunk of code from
NavigationDrawerAdapter
:and the ACTION_CANCEL case here too:
Also, I'm curious whether I should expect any changes now that the support library revision 22 has added new recycler view methods getlayoutPosition() and getadapterPosition()
The text was updated successfully, but these errors were encountered: