Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 7 中有这么大的数据Navigation Tabs。我的问题是同时加载所有选项卡,而不是一次加载一个选项卡。我尝试使用onHiddenChanged(boolean isHidden)但没有被调用。
Navigation Tabs
onHiddenChanged(boolean isHidden)
@Override public void setUserVisibleHint(boolean isVisibleToUser) { // TODO Auto-generated method stub super.setUserVisibleHint(isVisibleToUser); if(isVisibleToUser) { To do what is required to load data } else { Do nothing } }
当您选择每个选项卡时,将调用此方法。在每个选项卡片段活动中覆盖此方法。