Friday, 5 June 2015

ActionBarDrawerToggle ( three line ) Button not opening Drawer ???

You`ll Have to Use :getActionBar().setDisplayShowHomeEnabled(true);

// enabling action bar app icon and behaving it as toggle button  

 getActionBar().setDisplayHomeAsUpEnabled(true);   getActionBar().setHomeButtonEnabled(true);

&&

/**
 * This method required to enable icon to open drawer from click @hits
 */
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
      // Pass the event to ActionBarDrawerToggle, if it returns
      // true, then it has handled the app icon touch event
      
      if (mDrawerToggle.onOptionsItemSelected(item))
      {
          return true;   // this line important
      }
        
       // Handle your other action bar items...
       return super.onOptionsItemSelected(item);
}

No comments:

Post a Comment