[Android] Activate navigation view after switching activities

Asked 2 years ago, Updated 2 years ago, 22 views

When you click the navigation drawer menu item, use the int Moving on to another activity. If you click on a normal menu item, the drawer closes and the activity goes over When I click and move on to another activity, the activity is finished() and when I show the previous activity, I want to keep the drawer open. So I couldn't open the drawer while moving on to the intro It's no use.

android

2022-09-21 20:04

1 Answers

When creating a new project in Android Studio, select Navigation Drawer Activity and explain it based on the criteria you created.

There is a part in the class NavigationDrawerFragment that calls mDrawerLayout.closeDrawer(mFragmentContainerView);. If you don't call closeDrawer here, it won't close.

The drawer is then open after the activities that run are finished.


2022-09-21 20:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.