1. Download our Official Android App: Forums for Android!

Apps Navigation Drawer and switching activity

Discussion in 'Android Development' started by VMCG, Jul 12, 2016.

  1. VMCG

    VMCG Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Mar 25, 2016

    Mar 25, 2016
    3
    0
    5
    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?
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,307
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,307
    10,420
    1,988
    Male
    Software developer
    South West of England
    What does your child Activity need to do?
     

Share This Page

Loading...