• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Navigation Drawer and switching activity

VMCG

Lurker
Mar 25, 2016
3
0
I followed the official Android documentation on adding the navigation drawer to my project which was very straight forward.

How can I switch to a new activity and keep the activity and keep the navigation drawer?

if (id == R.id.nav_camera) {
Intent intent = new Intent(getApplicationContext(), Account.class);
startActivity(intent);
} else if (id == R.id.nav_gallery) {

} else if (id == R.id.nav_slideshow) {

}

I added this code which brings me to the new activity but does obviously not have the navigation drawer.

What is the best practice for switching between activities and keeping the navigation drawer?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones