Open Jonathan727 opened 9 years ago
Refer to this post to see if it helps:
http://stackoverflow.com/q/27070220/3410697
Which means:
Create a Handler and perform the notifyData calls inside it.
Since I can't reproduce this error I can't help you more. But I'm pretty sure the Handler will resolve the problem
Dirty fix :
try {
notifyItemChanged(lastPosition);
} catch (Exception e) {
Log.d(TAG, e.toString());
}
Normally, I facing this issue, when open/close drawer multiple times and fast.
Hello,
Here is a simple way to always reproduce this issue:
@Override
protected void onResume() {
super.onResume();
mTimer = new Timer();
mTimer.schedule(new TimerTask() {
@Override
public void run() {
for (int i = 0; i < mElementsList.size(); i++) {
Random r = new Random();
mElementsList.get(i).setFieldValue(r.nextInt(100));
mAdapter.notifyItemChanged(i);
}
}
}, 0, 1); // calls it faster then it computs the layout
}
Hope it helps
This will solve your issue
new Handler().post(new Runnable() { @Override public void run() { removeAt(position); } });
I've seen this crash a few times while using the navigation drawer.
Trace mentions this chunk of code from
NavigationDrawerAdapter
:and the _ACTIONCANCEL 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()