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: