1private void initListener() {
2 tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
3 @Override
4 public void onTabSelected(TabLayout.Tab tab) {
5 mSelectedPosition = tabLayout.getSelectedTabPosition();
6 lazyLoadAdapter.selectedTab(mSelectedPosition);
7 }
8 @Override
9 public void onTabUnselected(TabLayout.Tab tab) {
10 }
11 @Override
12 public void onTabReselected(TabLayout.Tab tab) {
13 }
14 });
15}
16