1

Hi I am exploring recycler view of android.I want to inflate a fragment inside the each item of recycler view.I want to change the layout of item in recycler view by clicking on item.Any Ideas on how to approach this problem

  • sonuds like a problem for sure! what is the scenario where you would want to do this? sounds like it goes against alot of conventions and norms – apelsoczi Jun 07 '16 at 18:34
  • Why are you trying to inflate a fragment instead of a view? – Darussian Jun 07 '16 at 19:19
  • What I am trying to do is change the layout of the item in recycle view on clicking on it – bhavirisetty pavan Jun 07 '16 at 20:03
  • I had problem that fragment displayed only for the first item. I solved the problem by setting new unique id for container layout before adding fragment. This answer helped me. https://stackoverflow.com/a/42994810/1931613. For example, myContainerLayout.setId(SystemClock.currentThreadTimeMillis().toInt()) – Kiryl Ivanou Sep 06 '19 at 14:15

1 Answers1

1

hmm... recyclerview is not for that, is it for recycle views ^^, if you want to dislpays fragments in a 'list' you can create a class extending LinearLayout which will display your fragments.

abdoulayeYATERA
  • 209
  • 1
  • 2