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
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
When fragmentB selected then prevnext = B
Is it possible?
kotlin fragment
add a comment |
up vote
0
down vote
favorite
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
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
kotlin fragment
edited Nov 9 at 18:00
Karol Dowbecki
12.6k62644
12.6k62644
asked Nov 9 at 17:52
Eng Kusnandar
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230956%2fhow-to-passing-data-when-tab-fragment-is-selected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown