java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling

Stack Overflow | Esby | 7 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    SetActionView - 'RecyclerView is computing'

    Stack Overflow | 7 months ago | Esby
    java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
  2. 0
    samebug tip
    Try to reset the previous listener before making any changes to the view.
  3. 0
    samebug tip
    This probably occurs because you are calling notifyItemInserted(position);, notifyItemChanged(position), or notifyItemRemoved(position); from a background thread (or from a callback, which runs on a background thread). Use a Handler to solve it.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc. ยท GitHub

    github.com | 9 months ago
    java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
  6. 0

    How to select and unselect the recycleview in android

    Stack Overflow | 10 months ago | Abserve Tech
    java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

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

    at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll()
  2. Android v7
    RecyclerView$Adapter.notifyDataSetChanged
    1. android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2116)
    2. android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onChanged(RecyclerView.java:4001)
    3. android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyChanged(RecyclerView.java:9242)
    4. android.support.v7.widget.RecyclerView$Adapter.notifyDataSetChanged(RecyclerView.java:5493)
    4 frames
  3. android.support.design
    NavigationMenuPresenter.updateMenuView
    1. android.support.design.internal.NavigationMenuPresenter$NavigationMenuAdapter.update(NavigationMenuPresenter.java:427)
    2. android.support.design.internal.NavigationMenuPresenter.updateMenuView(NavigationMenuPresenter.java:113)
    2 frames
  4. android.support.v7
    MenuItemImpl.setActionView
    1. android.support.v7.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:284)
    2. android.support.v7.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:1030)
    3. android.support.v7.view.menu.MenuBuilder.onItemActionRequestChanged(MenuBuilder.java:1076)
    4. android.support.v7.view.menu.MenuItemImpl.setActionView(MenuItemImpl.java:612)
    5. android.support.v7.view.menu.MenuItemImpl.setActionView(MenuItemImpl.java:620)
    6. android.support.v7.view.menu.MenuItemImpl.setActionView(MenuItemImpl.java:40)
    6 frames
  5. com.mycompany.myapp2
    MainActivity.access$1000018
    1. com.mycompany.myapp2.MainActivity$0$debug.updateText(MainActivity.java:323)
    2. com.mycompany.myapp2.MainActivity.updateText(MainActivity.java)
    3. com.mycompany.myapp2.MainActivity.access$1000018(MainActivity.java)
    3 frames