title: On Android Drawer Two icons Appear on ActionBar, Need Only One Icon
body: <p>I am implementing navigation drawer in my android app. But problem is two icons appear on actionbar. I have added ActionBarDrawerToggle and it seems second icon is displayed from ActionBarDrawerToggle. Please tell me where is the error in my code.</p>
  
  <p><a href="https://i.stack.imgur.com/9Wa6E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Wa6E.png" alt="enter image description here"></a></p>
  
  <p>Please tell me wheat could be error.</p>
  
  <p>And Here is complete code</p>
  
  <pre><code>package com.example.newdrawer;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.res.Configuration;
  import android.support.v4.app.ActionBarDrawerToggle;
  import android.support.v4.widget.DrawerLayout;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  import android.widget.Toast;
  
  public class MainActivity extends Activity {
  
      DrawerLayout mDrawerLayout;
      ActionBarDrawerToggle mActionBarDrawerToggle;
  
      ListView listView;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          getActionBar().setIcon(R.drawable.ic_launcher);
  
          String[] listItems = {"first", "second", "third"};
  
          listView = (ListView) findViewById(R.id.drawer);
  
          listView.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.textView1, listItems));
  
          listView.setOnItemClickListener(new DrawerItemClickListener());
  
          getActionBar().setDisplayHomeAsUpEnabled(true);
          getActionBar().setHomeButtonEnabled(true);
  
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mActionBarDrawerToggle = new ActionBarDrawerToggle(
                  this,                  /* host Activity */
                  mDrawerLayout,         /* DrawerLayout object */
                  R.drawable.ic_launcher,  /* nav drawer icon to replace 'Up' caret */
                  R.string.drawer_opened,  /* "open drawer" description */
                  R.string.drawer_closed  /* "close drawer" description */
                  ) {
  
              /** Called when a drawer has settled in a completely closed state. */
              public void onDrawerClosed(View view) {
                  super.onDrawerClosed(view);
                  getActionBar().setTitle("appname");
              }
  
              /** Called when a drawer has settled in a completely open state. */
              public void onDrawerOpened(View drawerView) {
                  super.onDrawerOpened(drawerView);
                  getActionBar().setTitle("select item");
              }
          };
  
          mDrawerLayout.setDrawerListener(mActionBarDrawerToggle);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  
      // to change up caret
      @Override
      protected void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
          // Sync the toggle state after onRestoreInstanceState has occurred.
          mActionBarDrawerToggle.syncState();
      }
      @Override
      public void onConfigurationChanged(Configuration newConfig){
          super.onConfigurationChanged(newConfig);
          mActionBarDrawerToggle.onConfigurationChanged(newConfig);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
  
          // The action bar home/up action should open or close the drawer.
          // ActionBarDrawerToggle will take care of this.
         if (mActionBarDrawerToggle.onOptionsItemSelected(item)) {
             return true;
         }
  
         return super.onOptionsItemSelected(item);
      }
  
      // navigation drawer click listener
      private class DrawerItemClickListener implements ListView.OnItemClickListener {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              Toast.makeText(MainActivity.this, "You clicked:"+String.valueOf(position), Toast.LENGTH_LONG).show();
              mDrawerLayout.closeDrawers();
          }
  
      }
  
  }
  </code></pre>
  
  <p>Here is my xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity" &gt;
  
      &lt;android.support.v4.widget.DrawerLayout
          android:id="@+id/drawer_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;TextView 
              android:layout_width = "match_parent"
              android:layout_height= "match_parent"
              android:id = "@+id/text1"
              android:text = "Hello World"/&gt;
  
          &lt;ListView 
              android:id="@+id/drawer"
              android:layout_width = "210dp"
              android:layout_height = "match_parent"
              android:layout_gravity = "start"
              android:background="@android:color/white"/&gt;
  
      &lt;/android.support.v4.widget.DrawerLayout&gt;"
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thank you in advance</p>