BottomBar icon indicating copy to clipboard operation
BottomBar copied to clipboard

open third tab onstart

Open rajesh-codes opened this issue 7 years ago • 3 comments
trafficstars

Assume I have five items in my menu. So I just want to open third tab on starting of the app. Currently it actually starts the first tab. So how to get third tab to be opened onstart?

rajesh-codes avatar Dec 02 '17 20:12 rajesh-codes

just call bottomBar.selectTabAtPosition(2); before you set bottomBar.setOnTabSelectListener

MadAxon avatar Dec 06 '17 09:12 MadAxon

Not working...if call that before .setOnTabSelectListener , it is saying app is stopped unfortunately.

rajesh-codes avatar Dec 06 '17 13:12 rajesh-codes

Hmm... But it's working for me. I did this way: `

    bottomBar = findViewById(R.id.bottomBar);
    bottomBar.selectTabAtPosition(1);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab_home:
                    <some code>
                case R.id.tab_profile:
                      <some code>
            }
        }
    });`

Can you provide a stack trace? Maybe your app simply catches nullpointerexception?

MadAxon avatar Dec 06 '17 15:12 MadAxon