title: How to change the title arrow icon in android navigation drawer
body: <p>I am new to android. I am trying to use a navigation drawer in my app. That's why I have taken a navigation drawer activity instead of blank activity when created the new project. Now it works fine so far. But I want to change the arrow icon to another image that is at top-left corner at the title bar. I have tried some example on goggle but no result. Can anyone please help me on this please !!! Here are my code below and the arrow image which I want to change >>></p>
  
  <p>the arrow should change >>></p>
  
  <p><a href="https://i.stack.imgur.com/77aR3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/77aR3.png" alt="enter image description here"></a></p>
  
  <p>My Main Activity >>></p>
  
  <pre><code>    public class MainActivity extends ActionBarActivity
          implements NavigationDrawerFragment.NavigationDrawerCallbacks {
  
      private NavigationDrawerFragment mNavigationDrawerFragment;
      private CharSequence mTitle;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mNavigationDrawerFragment = (NavigationDrawerFragment)
                  getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
          mTitle = getTitle();
  
          // Set up the drawer.
          mNavigationDrawerFragment.setUp(
                  R.id.navigation_drawer,
                  (DrawerLayout) findViewById(R.id.drawer_layout));
      }
  
      @Override
      public void onNavigationDrawerItemSelected(int position) {
          Fragment objFragment = null;
          switch (position) {
              case 0:
                  objFragment = new FragmentGoogle();
                  break;
              case 1:
                  objFragment = new FragmentYahoo();
                  break;
              case 2:
                  objFragment = new FragmentYoutube();
                  break;
              case 3:
                  objFragment = new FragmentFacebook();
                  break;
          }
          FragmentManager fragmentManager = getSupportFragmentManager();
          fragmentManager.beginTransaction()
                  .replace(R.id.container, objFragment)
                  .commit();
      }
  
      public void onSectionAttached(int number) {
          switch (number) {
              case 0:
                  mTitle = "Google";
                  break;
              case 1:
                  mTitle = "Yahoo";
                  break;
              case 2:
                  mTitle = "Youtube";
                  break;
              case 3:
                  mTitle = "Facebook";
                  break;
          }
      }
  
      public void restoreActionBar() {
          ActionBar actionBar = getSupportActionBar();
          actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
          actionBar.setDisplayShowTitleEnabled(true);
          actionBar.setTitle(mTitle);
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          if (!mNavigationDrawerFragment.isDrawerOpen()) {
              // Only show items in the action bar relevant to this screen
              // if the drawer is not showing. Otherwise, let the drawer
              // decide what to show in the action bar.
  //            getMenuInflater().inflate(R.menu.main, menu);     // it's showing the right menu
              restoreActionBar();
              return true;
          }
          return super.onCreateOptionsMenu(menu);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          int id = item.getItemId();
          if (id == R.id.action_settings) {
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
  }
  </code></pre>
  
  <p>My Navigation Drawer Fragment class >>></p>
  
  <pre><code>    public class NavigationDrawerFragment extends Fragment {
  
      Boolean isInternetPresent = false;
      ConnectionDetector cd;
  
      final String[] data ={"Google","Yahoo","Youtube", "Facebook"};
      final String[] fragments ={
              "com.example.user.navigationdrawertoggledemo.FragmentGoogle",
              "com.example.user.navigationdrawertoggledemo.FragmentYahoo",
              "com.example.user.navigationdrawertoggledemo.FragmentYoutube",
              "com.example.user.navigationdrawertoggledemo.FragmentFacebook"};
  
      private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position";
  
      private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned";
  
      private NavigationDrawerCallbacks mCallbacks;
      private ActionBarDrawerToggle mDrawerToggle;
  
      private DrawerLayout mDrawerLayout;
      private ListView mDrawerListView;
      private View mFragmentContainerView;
  
      private int mCurrentSelectedPosition = 0;
      private boolean mFromSavedInstanceState;
      private boolean mUserLearnedDrawer;
  
      public NavigationDrawerFragment() {
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
          mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false);
  
          if (savedInstanceState != null) {
              mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION);
              mFromSavedInstanceState = true;
          }
          selectItem(mCurrentSelectedPosition);
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          setHasOptionsMenu(true);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          mDrawerListView = (ListView) inflater.inflate(
                  R.layout.fragment_navigation_drawer, container, false);
          mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  ConnectivityManager connMgr = (ConnectivityManager) getActivity()
                          .getSystemService(Context.CONNECTIVITY_SERVICE);
                  NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
                  if (networkInfo != null &amp;&amp; networkInfo.isConnected()) {
                      selectItem(position);
                  } else {
                      showAlertDialog(getActivity(), "No Internet Connection",
                              "You don't have internet connection.", false);
                  }
              }
          });
  
          ObjectDrawerItem[] drawerItem = new ObjectDrawerItem[fragments.length];
          drawerItem[0] = new ObjectDrawerItem(R.drawable.google, "Google");
          drawerItem[1] = new ObjectDrawerItem(R.drawable.yahoo, "Yahoo");
          drawerItem[2] = new ObjectDrawerItem(R.drawable.youtube, "Youtube");
          drawerItem[3] = new ObjectDrawerItem(R.drawable.facebook, "Facebook");
  
          DrawerItemCustomAdapter adapter = new DrawerItemCustomAdapter
                  (getActivity(), R.layout.listview_item_row, drawerItem);
          mDrawerListView.setAdapter(adapter);
          mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
          return mDrawerListView;
      }
  
      public boolean isDrawerOpen() {
          return mDrawerLayout != null &amp;&amp; mDrawerLayout.isDrawerOpen(mFragmentContainerView);
      }
  
      public void setUp(int fragmentId, DrawerLayout drawerLayout) {
          mFragmentContainerView = getActivity().findViewById(fragmentId);
          mDrawerLayout = drawerLayout;
  
          mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
  
          ActionBar actionBar = getActionBar();
          actionBar.setDisplayHomeAsUpEnabled(true);
          actionBar.setHomeButtonEnabled(true);
  
          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 */
          ) {
              @Override
              public void onDrawerClosed(View drawerView) {
                  super.onDrawerClosed(drawerView);
                  if (!isAdded()) {
                      return;
                  }
                  getActivity().supportInvalidateOptionsMenu(); // calls onPrepareOptionsMenu()
              }
  
              @Override
              public void onDrawerOpened(View drawerView) {
                  super.onDrawerOpened(drawerView);
                  if (!isAdded()) {
                      return;
                  }
  
                  if (!mUserLearnedDrawer) {
                      mUserLearnedDrawer = true;
                      SharedPreferences sp = PreferenceManager
                              .getDefaultSharedPreferences(getActivity());
                      sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER, true).apply();
                  }
  
                  getActivity().supportInvalidateOptionsMenu(); // calls onPrepareOptionsMenu()
              }
          };
  
          if (!mUserLearnedDrawer &amp;&amp; !mFromSavedInstanceState) {
              mDrawerLayout.openDrawer(mFragmentContainerView);
          }
  
          mDrawerLayout.post(new Runnable() {
              @Override
              public void run() {
                  mDrawerToggle.syncState();
              }
          });
  
              mDrawerLayout.setDrawerListener(mDrawerToggle);
      }
  
      private void selectItem(int position) {
          mCurrentSelectedPosition = position;
          if (mDrawerListView != null) {
              mDrawerListView.setItemChecked(position, true);
          }
          if (mDrawerLayout != null) {
              mDrawerLayout.closeDrawer(mFragmentContainerView);
          }
          if (mCallbacks != null) {
              mCallbacks.onNavigationDrawerItemSelected(position);
          }
      }
  
      @Override
      public void onAttach(Activity activity) {
          super.onAttach(activity);
          try {
              mCallbacks = (NavigationDrawerCallbacks) activity;
          } catch (ClassCastException e) {
              throw new ClassCastException("Activity must implement NavigationDrawerCallbacks.");
          }
      }
  
      @Override
      public void onDetach() {
          super.onDetach();
          mCallbacks = null;
      }
  
      @Override
      public void onSaveInstanceState(Bundle outState) {
          super.onSaveInstanceState(outState);
          outState.putInt(STATE_SELECTED_POSITION, mCurrentSelectedPosition);
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
          mDrawerToggle.onConfigurationChanged(newConfig);
      }
  
      @Override
      public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
          if (mDrawerLayout != null &amp;&amp; isDrawerOpen()) {
  //            inflater.inflate(R.menu.global, menu);        // it's showing the setting icon at right side of action bar
              showGlobalContextActionBar();
          }
          super.onCreateOptionsMenu(menu, inflater);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          if (mDrawerToggle.onOptionsItemSelected(item)) {
              return true;
          }
          if (item.getItemId() == R.id.action_example) {
              Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show();
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
      private void showGlobalContextActionBar() {
          ActionBar actionBar = getActionBar();
          actionBar.setDisplayShowTitleEnabled(true);
          actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
          actionBar.setTitle(R.string.app_name);
      }
  
      private ActionBar getActionBar() {
          return ((ActionBarActivity) getActivity()).getSupportActionBar();
      }
  
      public static interface NavigationDrawerCallbacks {
          void onNavigationDrawerItemSelected(int position);
      }
  
      public void showAlertDialog(Context context, String title, String message, Boolean status) {
          AlertDialog alertDialog = new AlertDialog.Builder(context).create();
          alertDialog.setTitle(title);
          alertDialog.setMessage(message);
          alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail);
          alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
              }
          });
          alertDialog.show();
      }
  }
  </code></pre>
  
  <p>My fragment_navigation_drawer.xml >>></p>
  
  <pre><code>&lt;ListView
  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"
  android:choiceMode="singleChoice"
  android:divider="@android:color/transparent"
  android:dividerHeight="0dp"
  android:background="#cccc"
  tools:context=".NavigationDrawerFragment" /&gt;
  </code></pre>
  
  <p>My activity_main.xml >>></p>
  
  <pre><code>    &lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
      &lt;FrameLayout
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;fragment
          android:id="@+id/navigation_drawer"
          android:layout_width="@dimen/navigation_drawer_width"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:name="com.example.user.navigationdrawertoggledemo.NavigationDrawerFragment"
          tools:layout="@layout/fragment_navigation_drawer" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>Edited (Add Manifest)</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.user.navigationdrawertoggledemo" &gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  &lt;/manifest&gt;
  </code></pre>