I'm building an app where I want to show some additional information in the navigation drawer but after clicking inside of the navigation drawer it closes by default and I would like it to remain open till the user click outside the navigation drawer or presses the back button
Is this possible? And how do I implement it ? If not how else can I implement it without using the navigation view
I have tried using: mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN);
In my onCreate and onNavigationItemSelected ...Using it on the onCreate opens up the navigation drawer by default leaving me unable to close it
This is my drawer listener code;
DrawerLayout drawer = findViewById(R.id.drawer_layout);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…