Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. i have viewpager and fragments for each tabs ....
  2. first tab fragment has subfragments/childfragment
  3. Tab1 ----> FragmentA -----> recyclerview click --->FragmentB
  4. Tab2 ----> FragmentC
  5.  
  6. i have recyclerview in my activity now i have to show that recyclerview which is inside appbarlayout .... only in Homefragment.
  7. While another fragmentB open on recyclerview click of HomeFragment.
  8.  
  9. 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
  10. public void setUserVisibleHint(boolean isVisibleToUser) {
  11.  
  12. isVisible = isVisibleToUser;
  13. super.setUserVisibleHint(isVisibleToUser);
  14. // Make sure that fragment is currently visible
  15.  
  16. if(isVisible && getActivity() != null)
  17. {
  18. ((HomeActivity)getActivity()).hideShowCategoryRecyclerView(true);
  19. }
  20. }
  21. but this method in FragmentA is not getting called when i tab Second fragment ... then again FragmentA ...
  22. which method will be called ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement