.................................................. ........................

Closed due to the fact that the essence of the question is incomprehensible to the participants AK , pavlofff , Alexey Shimansky , Vadim Ovchinnikov , αλεχολυτ Jan 21, 17 at 21:20 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    Try to write in the body of the question what you have already tried to do, what problems you have and give examples of code. - Yuriy SPb

2 answers 2

According to en-SO , this is done like this:

Take a DrawerLayout and an ActionBarDrawerToggle and customize them as necessary. Here is a sample code (inside the activation class onCreate method):

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle mDrawerToggle; setSupportActionBar(toolbar); final ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); mDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.hello_world, R.string.hello_world) { public void onDrawerClosed(View view) { supportInvalidateOptionsMenu(); //drawerOpened = false; } public void onDrawerOpened(View drawerView) { supportInvalidateOptionsMenu(); //drawerOpened = true; } }; mDrawerToggle.setDrawerIndicatorEnabled(true); drawerLayout.setDrawerListener(mDrawerToggle); mDrawerToggle.syncState(); } 

You also need to add state synchronization during the application life cycle, adding / redefining these methods in the activit

 @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); mDrawerToggle.syncState(); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } 

    Java or is it Android?

    for Android, the easiest way is to use Android Studio, creating an activation by choosing the type Navigation, everything is generated by itself, then you can change something, copy it, port it somewhere, say to the outdated eclipse