android - Cannot call this method while RecyclerView is computing a layout or scrolling -


i tried looking @ answer answers similar question: https://stackoverflow.com/a/31069171/6313011

i getting error:

"cannot call method while recyclerview computing layout or scrolling"

in adapter class have private boolean monbind init false.

then have

    @override     public void onbindviewholder(recyclerviewholder holder, int position) {         monbind = true;         holder.bindrow(mylist.get(position), position);         monbind = false;     } 

and in recyclerviewholder method have:

myedittext.setonfocuschangelistener(new view.onfocuschangelistener() {                 @override                 public void onfocuschange(view view, boolean focus) {                     if (!monbind && !focus) {                         notifydatasetchanged(); //causes error!                     }                 }             }); 

i thought using monbind approach fix error apparently not. how fix?


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo