java.lang.IllegalStateException: Illegal State: Object is no longer valid to operate on. Was it deleted by another thread?

Stack Overflow | the beest | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    IllegalStateException when using RealmRecyclerViewAdapter

    Stack Overflow | 6 months ago | the beest
    java.lang.IllegalStateException: Illegal State: Object is no longer valid to operate on. Was it deleted by another thread?

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Illegal State: Object is no longer valid to operate on. Was it deleted by another thread?

      at io.realm.internal.UncheckedRow.nativeGetBoolean()
    2. io.realm.internal
      UncheckedRow.getBoolean
      1. io.realm.internal.UncheckedRow.nativeGetBoolean(Native Method)
      2. io.realm.internal.UncheckedRow.getBoolean(UncheckedRow.java:133)
      2 frames
    3. io.realm
      ItemRealmProxy.realmGet$mIndexed
      1. io.realm.ItemRealmProxy.realmGet$mIndexed(ItemRealmProxy.java:257)
      1 frame
    4. com.app.models
      Item.isIndexed
      1. com.app.models.Item.isIndexed(Item.java:229)
      1 frame
    5. com.app.adapters
      AdapterSearch.onViewRecycled
      1. com.app.adapters.AdapterSearch.onViewRecycled(AdapterSearch.java:100)
      2. com.app.adapters.AdapterSearch.onViewRecycled(AdapterSearch.java:42)
      2 frames
    6. Android v7
      RecyclerView.onLayout
      1. android.support.v7.widget.RecyclerView$Recycler.dispatchViewRecycled(RecyclerView.java:5171)
      2. android.support.v7.widget.RecyclerView$Recycler.addViewHolderToRecycledViewPool(RecyclerView.java:4936)
      3. android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:4919)
      4. android.support.v7.widget.RecyclerView$LayoutManager.scrapOrRecycleView(RecyclerView.java:7313)
      5. android.support.v7.widget.RecyclerView$LayoutManager.detachAndScrapAttachedViews(RecyclerView.java:7298)
      6. android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:542)
      7. android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
      8. android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2906)
      9. android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3283)
      9 frames
    7. Android Platform
      ViewGroup.layout
      1. android.view.View.layout(View.java:16630)
      2. android.view.ViewGroup.layout(ViewGroup.java:5437)
      2 frames
    8. Android Support v4
      SwipeRefreshLayout.onLayout
      1. android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:596)
      1 frame
    9. Android Platform
      ViewGroup.layout
      1. android.view.View.layout(View.java:16630)
      2. android.view.ViewGroup.layout(ViewGroup.java:5437)
      3. android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
      4. android.view.View.layout(View.java:16630)
      5. android.view.ViewGroup.layout(ViewGroup.java:5437)
      6. android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
      7. android.view.View.layout(View.java:16630)
      8. android.view.ViewGroup.layout(ViewGroup.java:5437)
      9. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      10. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      11. android.view.View.layout(View.java:16630)
      12. android.view.ViewGroup.layout(ViewGroup.java:5437)
      13. android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
      14. android.view.View.layout(View.java:16630)
      15. android.view.ViewGroup.layout(ViewGroup.java:5437)
      15 frames
    10. Android Support v4
      DrawerLayout.onLayout
      1. android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1187)
      1 frame
    11. Android Platform
      FrameLayout.onLayout
      1. android.view.View.layout(View.java:16630)
      2. android.view.ViewGroup.layout(ViewGroup.java:5437)
      3. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      4. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      5. android.view.View.layout(View.java:16630)
      6. android.view.ViewGroup.layout(ViewGroup.java:5437)
      7. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
      8. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
      9. android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
      10. android.view.View.layout(View.java:16630)
      11. android.view.ViewGroup.layout(ViewGroup.java:5437)
      12. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      13. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      14. android.view.View.layout(View.java:16630)
      15. android.view.ViewGroup.layout(ViewGroup.java:5437)
      16. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
      17. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
      18. android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
      19. android.view.View.layout(View.java:16630)
      20. android.view.ViewGroup.layout(ViewGroup.java:5437)
      21. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      22. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      22 frames
    12. Android
      PhoneWindow$DecorView.onLayout
      1. com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
      1 frame