0

I am using a navigation drawer in my application but somehow the ic_drawer icon (the three stripes) is not showing up where it should. Since I am not able to post pictures yet, you may have a look on my Screenshot with the link:

ic_drawer icon

Furthermore I fail to make the application icon show up as well. I only accomplished to replace the drawer icon with my app icon but I want both.

All in all I want my application to look like this example from the Android Developer design guide.

This method in the NavigationDrawerFragment (which is autoimplemented by AndroidStudio) sets up the icon I am able to see:

public void setUp(int fragmentId, DrawerLayout drawerLayout) {
        mFragmentContainerView = getActivity().findViewById(fragmentId);
        mDrawerLayout = drawerLayout;

        ...

        ActionBar actionBar = getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);

        // ActionBarDrawerToggle ties together the the proper interactions
        // between the navigation drawer and the action bar app icon.
        mDrawerToggle = new ActionBarDrawerToggle(
                getActivity(),                    /* host Activity */
                mDrawerLayout,                    /* DrawerLayout object */
                R.drawable.ic_drawer,             /* nav drawer image to replace 'Up' caret */
                R.string.navigation_drawer_open,  /* "open drawer" description for accessibility */
                R.string.navigation_drawer_close  /* "close drawer" description for accessibility */
        ) {
            ...
        };
        // If the user hasn't 'learned' about the drawer, open it to introduce them to the drawer,
        // per the navigation drawer design guidelines.
        if (!mUserLearnedDrawer && !mFromSavedInstanceState) {
            mDrawerLayout.openDrawer(mFragmentContainerView);
        }

        // Defer code dependent on restoration of previous instance state.
        mDrawerLayout.post(new Runnable() {
            @Override
            public void run() {
                mDrawerToggle.syncState();
            }
        });

        mDrawerLayout.setDrawerListener(mDrawerToggle);
    }

Thanks for your help in advance!

  • Post some code fo your App to give us a chance to help you. – Skizo-ozᴉʞS ツ Feb 02 '15 at 15:58
  • HI! @Tafelbomber look here :http://stackoverflow.com/questions/19724567/how-to-add-menu-indicator-next-to-action-bars-app-icon – Josef Feb 02 '15 at 16:21
  • @Josef Hey! Thanks but that did not help either (still the exactly same result). But I updated the code in my question. Is there any other code that I should add? I'm pretty desperate by this time since I am trying and googling for nearly a week now... – Tafelbomber Feb 02 '15 at 16:40
  • What about this :http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ ? – Josef Feb 02 '15 at 17:04
  • Either I dont understand what you are pointing out to me (maybe the solution is too obvious) or the code from the tutorial already is in my code: ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); – Tafelbomber Feb 02 '15 at 17:28
  • If you want to implement navigation drawer you can try another code and not to stuck only with yours. – Josef Feb 02 '15 at 17:35

0 Answers0