Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i have viewpager and fragments for each tabs ....
- first tab fragment has subfragments/childfragment
- Tab1 ----> FragmentA -----> recyclerview click --->FragmentB
- Tab2 ----> FragmentC
- i have recyclerview in my activity now i have to show that recyclerview which is inside appbarlayout .... only in Homefragment.
- While another fragmentB open on recyclerview click of HomeFragment.
- now i just want to show appbarlayout only in case of fragmentA whle it should be hidden in all other cases .... so i resolved using @Override
- public void setUserVisibleHint(boolean isVisibleToUser) {
- isVisible = isVisibleToUser;
- super.setUserVisibleHint(isVisibleToUser);
- // Make sure that fragment is currently visible
- if(isVisible && getActivity() != null)
- {
- ((HomeActivity)getActivity()).hideShowCategoryRecyclerView(true);
- }
- }
- but this method in FragmentA is not getting called when i tab Second fragment ... then again FragmentA ...
- which method will be called ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement