How to refresh tabs content dynamically while switching between one tab to other in fragment?

后端 未结 1 337
小蘑菇
小蘑菇 2021-01-17 05:18

I have Activity called CourseActivity.java,in that i have 2 tabs by names UserCourses and FavouriteCourses.I have some list of courses in first tab.And it have icon,on selec

1条回答
  •  礼貌的吻别
    2021-01-17 05:42

    you should override setUserVisibleHint method in your fragment and put your refreshing code in it

        @Override
        public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
           if (isVisibleToUser && isResumed()) {
    
           }
        }
    

    0 讨论(0)
提交回复
热议问题