title: Toggle button not working for navigation drawer
body: <p>I am implementing a Navigation Drawer for my android application. I got the drawer to work by dragging from the side, but the home/toggle button on the action bar doesn't change to the icon I want and doesn't respond to clicks, thou the onDrawerClosed and onDrawerOpened methods defined in it are called.
  My code is as follows:</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"
       android:id="@+id/drawer_layout"
       android:layout_width="match_parent"
       android:layout_height="match_parent"&gt;
  
  
      &lt;fragment
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/loadingFragment"
          android:name="com.whostr.clients.android.LoadingFragment" /&gt;
  
      &lt;fragment 
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/eventFragment"
          android:name="com.whostr.clients.android.EventDisplayFragment"/&gt;
  
      &lt;fragment 
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/emptyFragment"
          android:name="com.whostr.clients.android.EmptyView"/&gt;
  
  
  
  &lt;!--  Listview to display slider menu --&gt;
  &lt;ListView android:id="@+id/left_drawer"
      android:layout_width = "240dp"
      android:layout_height = "match_parent"
      android:layout_gravity = "start"
      android:choiceMode = "singleChoice"
      android:dividerHeight = "1dp"
      android:divider = "@android:color/transparent"
      android:background="#111"
      /&gt;
  </code></pre>
  
  <p></p>
  
  <p>And in the activity I have the following code:</p>
  
  <pre><code>    @Override
  public void onCreate(Bundle savedDataInstace)
  {
      super.onCreate(savedDataInstace);
      setContentView(R.layout.eventdisplay);
  
      fm = getSupportFragmentManager();
      //get fragments by id
      fragments[EVENT_VIEW]= fm.findFragmentById(R.id.eventFragment);
      fragments[LOADING] = fm.findFragmentById(R.id.loadingFragment);
      fragments[EMPTY_VIEW] = fm.findFragmentById(R.id.emptyFragment);
  
  
      menuList = getResources().getStringArray(R.array.menuArray);
      mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
      mDrawerList = (ListView) findViewById(R.id.left_drawer);
  
      mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawwer_open, R.string.drawer_closed)
                          {
                              /*
                               * Called when a drawer has settled in a completely closed state
                               */
                              public void onDrawerClosed(View view)
                              {
                                  Log.d("drawerToggle", "Drawer closed");
                                  super.onDrawerClosed(view);
                                  getActionBar().setTitle(R.string.app_name);
                                  invalidateOptionsMenu(); //Creates call to onPrepareOptionsMenu()
                              }
  
                              /*
                               * Called when a drawer has settled in a completely open state
                               */
                              public void onDrawerOpened(View drawerView)
                              {
                                  Log.d("drawerToggle", "Drawer opened");
                                  super.onDrawerOpened(drawerView);
                                  getActionBar().setTitle("NavigationDrawer");
                                  invalidateOptionsMenu();
                              }
                          };
      mDrawerLayout.setDrawerListener(mDrawerToggle);
  
      //Set the adapter for the list view
      mDrawerList.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.drawer_list_item, menuList));
      mDrawerList.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position,
                  long id) {
              Log.d("navigationDrawer", "Clicked on an item");
          }
  
      });
  
  
      FragmentTransaction transaction = fm.beginTransaction();
  
      //Hide the event view
      transaction.hide(fragments[EVENT_VIEW]);
      transaction.hide(fragments[EMPTY_VIEW]);
      transaction.commit();
  
      AsyncTask&lt;String, Void, EventResponseCollection&gt; task = new GetEventsNearByAsyncTask().execute();
      try {
          if(task != null)
              events = task.get().getItems();
  
      } catch (InterruptedException | ExecutionException e) {
          Log.d("viewEvent", "Error when retrieving task details " + e.getMessage());
      }
  
      if(events == null)
      {
          //show create your own event fragment
          changeFragment(EMPTY_VIEW);
      }
      else
      {
          Log.d("viewEvent", "I have " + events.size());
          //show proper fragment with the first event displayed
          currentEvent = events.get(eventIndex);
          ((EventDisplayFragment) fragments[EVENT_VIEW]).updateFragment(currentEvent);
          changeFragment(EVENT_VIEW);
      }
  }
  
      @Override
  public boolean onOptionsItemSelected(MenuItem item)
  {
      Log.d("onOptionsItemSelected", "In the on item select");
      //Pass the event to ActionBarDrawerToggle, if it returns
      //true, then it has handled the app icon touch event
      if(mDrawerToggle.onOptionsItemSelected(item))
      {
          Log.d("onOptionsItemSelected", "Clicked on action bar item");
          return true;
      }
  
      //Handle your other action bar items...
  
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>Does anyone have any suggestion on what I can do? I've tried all solutions I found online to make this work, but apparently I'm out of luck and nothing seems to be working :(</p>