ViewPager + RecyclerView issue in android

前端 未结 3 445
逝去的感伤
逝去的感伤 2020-11-28 16:58

Hi I have Tablayout with Viewpager and i am using Fragment for tablayout. Now in every Tablayout fragments I have Recyclerview

3条回答
  •  广开言路
    2020-11-28 17:16

    Problem:

    There's no way to pass a Serializable ArrayList in a Bundle. Look at the docs page here Bundle docs

    Solution:

    Change your SubCategoryModel to implement Parcelable and then use bundle.putParcelableArrayList(key, list) and bundle.getParcelableArrayList(key) to pass the ArrayList to the FragmentArgs and get them from the Fragment

提交回复
热议问题