1

I am trying to display a fragment under each RecylerView item on click and collapse/remove the same if user clicks on it again. I was able to pull this off by following the answer available here https://stackoverflow.com/a/37212091 But the main problem occurs when we try to scroll in the recycler view with all the items expanded (displaying fragment) and intermittently it crashes with below logs. I have tried looking it up and find something similar but nobody had a proper solution for this crash.

java.lang.IllegalArgumentException: No view found for id 0x19 (unknown) for fragment NowFragment{ec5e02f} (7d3220ae-56be-43ad-af1e-804d18b27689) id=0x19}
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:315)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1187)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)

I found someone facing a similar crash here: Add fragment in RecyclerView.ViewHolder But there is no concrete solution. Can anyone please help me to resolve this?

DeaconOut
  • 11
  • 1

0 Answers0