Android Nested Fragments

Android Kotlin Nested fragments in viewpager

Greetings,

If you have a scenario where you have MainActivity that calls view pager and the view pager have recycler view or list view fragment and you want to show detail view fragment on click of item of the list view,

or if you have the following error showing:

java.lang.IllegalArgumentException: No view found for id 0x7f080011 
   for fragment

you can achieve your scenario and fix the error easily by using the :

supportFragmentManager

for calling the view pager adapter, and using :

activity!!.supportFragmentManager.beginTransaction()

in the Listview fragment for calling detail view fragment.

if you have any comment or question please don’t hesitate to write out in the comments section.


Posted

in

, , , , ,

by

Comments

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *