Android - How to get Extras in an InnerFragment (Nested Fragment)?

1

How to get a Extra within Fragment nested in another Fragment?

I have an Activity with the following Layout:

Activity (que infla um){
  //Aqui a activity infla 3 Fragments para criar um BottomNavigation
  Fragment (que infla um){
    //Em um certo Fragment (uma dos três botões do BottomNavigation, é inflado alguns fragmentos em uma TabLayout
    InnerFragment
  }
}

I can not send a Bundle to InnerFragment , just for Fragment, and according to the Fragments documentation should never communicate directly.

And the getActivity().getIntent().getExtra().getInt() approach is not appropriate. Since it makes the fragment not reusable.

What would be the right approach?

Sample YouTube layout:

    
asked by anonymous 16.06.2018 / 19:07

0 answers