@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = DataBindingUtil.setContentView(this, R.layout.activity_fragment_tab_controller); final TabControllerFragment tabControllerFragment = (TabControllerFragment) getSupportFragmentManager().findFragmentById(R.id.fragment); tabController = tabControllerFragment.getTabController(); tabController.setChangeListener(this); if (savedInstanceState != null) { binding.bottomBar.onRestoreInstanceState(savedInstanceState.getParcelable(BUNDLE_BOTTOM_BAR)); } binding.bottomBar.setOnTabSelectListener(new BottomBarListener(this), true); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = DataBindingUtil.setContentView(this, R.layout.activity_tab_controller); tabController = new TabController(getSupportFragmentManager(), R.id.container, new AttachDetachHandler()); tabController.setChangeListener(this); if (savedInstanceState != null) { binding.bottomBar.onRestoreInstanceState(savedInstanceState.getParcelable(BUNDLE_BOTTOM_BAR)); tabController.restore(savedInstanceState); } binding.bottomBar.setOnTabSelectListener(new BottomBarListener(this), true); }