title: Android navigation drawer toggle icon to right
body: <p>My requirement is shown in the picture below  My navigation drawer should be opened from the right side. I have implemented this. My navigation drawer open from right to left. But the problem is toggle icon is always on the left side. How can I set toggle icon to the right?</p>
  
  <p>I have checked the following SO questions, but none of them came to any help:</p>
  
  <p><a href="https://stackoverflow.com/questions/33497055/change-toggle-button-image-icon-in-navigation-drawer-right-to-left">Change toggle button image Icon In Navigation Drawer right to left</a></p>
  
  <p><a href="https://stackoverflow.com/questions/27330702/drawer-toggle-in-right-drawer">Drawer Toggle in right Drawer</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21580172/right-side-navigation-drawer-icon-always-to-the-left">enter link description here</a></p>
  
  <p><a href="https://i.stack.imgur.com/SrAuJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SrAuJ.jpg" alt="enter image description here"></a></p>
  
  <p>Here is what I have tried:</p>
  
  <p>code for my layout <strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/drawer"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:openDrawer="end"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          tools:context="com.example.nav.MainActivity"
          android:foregroundGravity="right"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="end"
              android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:background="?attr/colorPrimary"
                  android:layout_gravity="right"
                  app:popupTheme="@style/AppTheme.PopupOverlay"
                  android:foregroundGravity="right"
                  android:textAlignment="viewEnd"
                  android:touchscreenBlocksFocus="false" /&gt;
  
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;include layout="@layout/content_main" /&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;android.support.design.widget.NavigationView
          android:id="@+id/navigation_view"
          android:layout_height="match_parent"
          android:layout_width="wrap_content"
          android:layout_gravity="end"
          app:headerLayout="@layout/nav_header"
          app:menu="@menu/menu_navigation"
          android:textAlignment="viewEnd" /&gt;
  
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Code for my activity </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      private DrawerLayout drawerLayout;
      private Toolbar toolbar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          initNavigationDrawer();
  
      }
  
      @TargetApi(Build.VERSION_CODES.M)
      public void initNavigationDrawer() {
  
          NavigationView navigationView = (NavigationView)findViewById(R.id.navigation_view);
          navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
              @Override
              public boolean onNavigationItemSelected(MenuItem menuItem) {
  
                  int id = menuItem.getItemId();
  
                  switch (id){
                      case R.id.home:
                          Toast.makeText(getApplicationContext(),"Home",Toast.LENGTH_SHORT).show();
                          drawerLayout.closeDrawers();
                          break;
                      case R.id.settings:
                          Toast.makeText(getApplicationContext(),"Settings",Toast.LENGTH_SHORT).show();
                          break;
                      case R.id.trash:
                          Toast.makeText(getApplicationContext(),"Trash",Toast.LENGTH_SHORT).show();
                          drawerLayout.closeDrawers();
                          break;
                      case R.id.logout:
                          finish();
  
                  }
                  return true;
              }
          });
          drawerLayout = (DrawerLayout)findViewById(R.id.drawer);
  
          ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.drawer_open,R.string.drawer_close){
  
              @Override
              public void onDrawerClosed(View v){
                  super.onDrawerClosed(v);
              }
  
              @Override
              public void onDrawerOpened(View v) {
                  super.onDrawerOpened(v);
              }
  
              @Override
              public boolean onOptionsItemSelected(MenuItem item) {
                  if (item != null &amp;&amp; item.getItemId() == android.R.id.home) {
                      if (drawerLayout.isDrawerOpen(Gravity.RIGHT)) {
                          drawerLayout.closeDrawer(Gravity.RIGHT);
                      }
                      else {
                          drawerLayout.openDrawer(Gravity.RIGHT);
                      }
                  }
                  return false;
              }
          };
          drawerLayout.addDrawerListener(actionBarDrawerToggle);
          actionBarDrawerToggle.syncState();
  
          toolbar.setNavigationOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  if (drawerLayout.isDrawerOpen(Gravity.RIGHT)) {
                      drawerLayout.closeDrawer(Gravity.RIGHT);
                  } else {
                      drawerLayout.openDrawer(Gravity.RIGHT);
                  }
              }
          });
      }
  
  }
  </code></pre>