google / blockly-android

Blockly for Android
Apache License 2.0
672 stars 209 forks source link

Crash: RecyclerView child not recycled correctly #773

Closed AnmAtAnm closed 5 years ago

AnmAtAnm commented 5 years ago

I haven't narrowed how to duplicate this, but I got this twice.

2019-02-11 16:50:30.741 14203-14203/com.google.blockly.demo E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.google.blockly.demo, PID: 14203
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
        at android.view.ViewGroup.addViewInner(ViewGroup.java:4937)
        at android.view.ViewGroup.addView(ViewGroup.java:4768)
        at android.view.ViewGroup.addView(ViewGroup.java:4740)
        at com.google.blockly.android.ui.BlockRecyclerViewHelper$Adapter.onBindViewHolder(BlockRecyclerViewHelper.java:281)
        at com.google.blockly.android.ui.BlockRecyclerViewHelper$1.onChanged(BlockRecyclerViewHelper.java:85)
        at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyChanged(RecyclerView.java:11997)
        at android.support.v7.widget.RecyclerView$Adapter.notifyDataSetChanged(RecyclerView.java:7070)
        at com.google.blockly.android.ui.BlockRecyclerViewHelper.setCurrentCategory(BlockRecyclerViewHelper.java:152)
        at com.google.blockly.android.FlyoutFragment.setCurrentCategory(FlyoutFragment.java:194)
        at com.google.blockly.android.control.FlyoutController.setToolboxCategory(FlyoutController.java:273)
        at com.google.blockly.android.control.FlyoutController.access$100(FlyoutController.java:37)
        at com.google.blockly.android.control.FlyoutController$2.onCategoryClicked(FlyoutController.java:87)
        at com.google.blockly.android.ui.CategoryTabs.onCategoryClicked(CategoryTabs.java:190)
        at com.google.blockly.android.ui.CategoryTabs.access$200(CategoryTabs.java:49)
        at com.google.blockly.android.ui.CategoryTabs$CategoryAdapter$1.onClick(CategoryTabs.java:233)
        at android.view.View.performClick(View.java:6294)