How to passing data when tab fragment is selected
up vote 0 down vote favorite I just learning tab fragment and i wonder if i could passing a data when a tab is selected. I created one activity called : Menus and two fragment (fragmentA and fragmentB). In Menus.kt i created: val prevnext:String I expected when the tab selected the prevnext value is change. When fragmentA selected then prevnext = A When fragmentB selected then prevnext = B Is it possible? kotlin fragment share | improve this question edited Nov 9 at 18:00 Karol Dowbecki 12.6k 6 26 44 asked Nov 9 at 17:52 Eng Kusnandar 1 1 add a comment | up vote 0 down vote favorite I just learning tab fragment and i wonder if i could passing a data when a tab is selected. I created one activity called : Menus and two fragment (fragmentA and fragmentB). In Menus.kt i created: val prevnext:String I expected when the tab selected the prevnext value is change. When fragmentA selected then prevnext = A ...