roughike / BottomBar

(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.
Apache License 2.0
8.43k stars 1.51k forks source link

Call Fragment onTabSelect #868

Open Harrumnoor opened 6 years ago

Harrumnoor commented 6 years ago

I am not able to call a fragment onTabselect. there is no error but the fragment doesnt load. BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar); bottomBar.setOnTabSelectListener(new OnTabSelectListener() { @Override public void onTabSelected(@IdRes int tabId) { if (tabId == R.id.tab_friends) { Fragment selectedFragment = ItemOneFragment.newInstance();

                FragmentTransaction transaction = getFragmentManager().beginTransaction();
                transaction.replace(R.id.frame_layout,selectedFragment);
                transaction.commit();
            }
        }
    });