title: Expandable Navigation Drawer is not moving
body: <p>I am very new to action bar sherlock and navigation drawer. I have created a simple navigation drawer. The drawer is open by default whenever the app starts, and there is no way to hide the drawer after interacting with it. <strong>What should I do, if I want the user to open the navigation drawer when he clicks the top left corner of the screen and it should hide itself if the user selects as option inside it, or again clicks the top left app icon on the screen?</strong> </p>
  
  <p>The <strong>MainActivity</strong>:</p>
  
  <pre><code>public class MainActivity extends Activity {
      DrawerLayout mDrawerLayout;
      ExpandableListView mDrawerList;
      ExpandableListAdapter listAdapter;
      List&lt;String&gt; listDataHeader;
      HashMap&lt;String, List&lt;String&gt;&gt; listDataChild;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mDrawerList = (ExpandableListView) findViewById(R.id.left_drawer);
  
  
  
              // preparing list data
              prepareListData();
  
              listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
  
              // setting list adapter
              mDrawerList.setAdapter(listAdapter);
  
              // Listview Group click listener
              mDrawerList.setOnGroupClickListener(new OnGroupClickListener() {
  
                  @Override
                  public boolean onGroupClick(ExpandableListView parent, View v,
                          int groupPosition, long id) {
                      // Toast.makeText(getApplicationContext(),
                      // "Group Clicked " + listDataHeader.get(groupPosition),
                      // Toast.LENGTH_SHORT).show();
                      return false;
                  }
              });
  
              // Listview Group expanded listener
              mDrawerList.setOnGroupExpandListener(new OnGroupExpandListener() {
  
                  @Override
                  public void onGroupExpand(int groupPosition) {
                      Toast.makeText(getApplicationContext(),
                              listDataHeader.get(groupPosition) + " Expanded",
                              Toast.LENGTH_SHORT).show();
                  }
              });
  
              // Listview Group collasped listener
              mDrawerList.setOnGroupCollapseListener(new OnGroupCollapseListener() {
  
                  @Override
                  public void onGroupCollapse(int groupPosition) {
                      Toast.makeText(getApplicationContext(),
                              listDataHeader.get(groupPosition) + " Collapsed",
                              Toast.LENGTH_SHORT).show();
  
                  }
              });
  
              // Listview on child click listener
              mDrawerList.setOnChildClickListener(new OnChildClickListener() {
  
                  @Override
                  public boolean onChildClick(ExpandableListView parent, View v,
                          int groupPosition, int childPosition, long id) {
                      // TODO Auto-generated method stub
                      Toast.makeText(
                              getApplicationContext(),
                              listDataHeader.get(groupPosition)
                                      + " : "
                                      + listDataChild.get(
                                              listDataHeader.get(groupPosition)).get(
                                              childPosition), Toast.LENGTH_SHORT)
                              .show();
                      return false;
                  }
              });
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  
      /*
       * Preparing the list data
       */
      private void prepareListData() {
          listDataHeader = new ArrayList&lt;String&gt;();
          listDataChild = new HashMap&lt;String, List&lt;String&gt;&gt;();
  
          // Adding header data
          listDataHeader.add("Today");
  
          // Adding child data
          List&lt;String&gt; today = new ArrayList&lt;String&gt;();
          today.add("Tanushree Guha");
          today.add("Prasenjit Roy");
          today.add("Pan Singh Tomar");
          today.add("Milka Singh");
          today.add("Rohit Ramanujan");
          today.add("Ramesh Bhatt");
          today.add("Debjani Brahma");
  
          listDataHeader.add("Tomorrow");
          List&lt;String&gt; tomorrow = new ArrayList&lt;String&gt;();
          tomorrow.add("Dipanjan Bhowmik");
          tomorrow.add("Sarmistha Sinha");
          tomorrow.add("Pranay Lalwani");
          tomorrow.add("Mohit Shaw");
          tomorrow.add("Lovelace Agarwal");
          tomorrow.add("Tanmay Banerjee");
  
          listDataHeader.add("Later");
          List&lt;String&gt; later = new ArrayList&lt;String&gt;();
          later.add("Yusuf Khan");
          later.add("Jitendar Sharma");
          later.add("Debashree Roy");
          later.add("Mainak Ghosh");
          later.add("Olivia Gomes");
  
          listDataChild.put(listDataHeader.get(0), today); // Header, Child data
          listDataChild.put(listDataHeader.get(1), tomorrow);
          listDataChild.put(listDataHeader.get(2), later);
      }
  
  }
  </code></pre>
  
  <p>The <strong>ExpandableListAdapter</strong> class:</p>
  
  <pre><code>public class ExpandableListAdapter extends BaseExpandableListAdapter {
  
      private Context _context;
      private List&lt;String&gt; _listDataHeader; // header titles
      // child data in format of header title, child title
      private HashMap&lt;String, List&lt;String&gt;&gt; _listDataChild;
  
      public ExpandableListAdapter(Context context, List&lt;String&gt; listDataHeader,
              HashMap&lt;String, List&lt;String&gt;&gt; listChildData) {
          this._context = context;
          this._listDataHeader = listDataHeader;
          this._listDataChild = listChildData;
      }
  
      @Override
      public Object getChild(int groupPosition, int childPosititon) {
          return this._listDataChild.get(this._listDataHeader.get(groupPosition))
                  .get(childPosititon);
      }
  
      @Override
      public long getChildId(int groupPosition, int childPosition) {
          return childPosition;
      }
  
      @Override
      public View getChildView(int groupPosition, final int childPosition,
              boolean isLastChild, View convertView, ViewGroup parent) {
  
          final String childText = (String) getChild(groupPosition, childPosition);
  
          if (convertView == null) {
              LayoutInflater infalInflater = (LayoutInflater) this._context
                      .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              convertView = infalInflater.inflate(R.layout.list_item, null);
          }
  
          TextView txtListChild = (TextView) convertView
                  .findViewById(R.id.lblListItem);
  
          txtListChild.setText(childText);
          return convertView;
      }
  
      @Override
      public int getChildrenCount(int groupPosition) {
          return this._listDataChild.get(this._listDataHeader.get(groupPosition))
                  .size();
      }
  
      @Override
      public Object getGroup(int groupPosition) {
          return this._listDataHeader.get(groupPosition);
      }
  
      @Override
      public int getGroupCount() {
          return this._listDataHeader.size();
      }
  
      @Override
      public long getGroupId(int groupPosition) {
          return groupPosition;
      }
  
      @Override
      public View getGroupView(int groupPosition, boolean isExpanded,
              View convertView, ViewGroup parent) {
          String headerTitle = (String) getGroup(groupPosition);
          if (convertView == null) {
              LayoutInflater infalInflater = (LayoutInflater) this._context
                      .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              convertView = infalInflater.inflate(R.layout.list_group, null);
          }
  
          TextView lblListHeader = (TextView) convertView
                  .findViewById(R.id.lblListHeader);
          lblListHeader.setTypeface(null, Typeface.BOLD);
          lblListHeader.setText(headerTitle);
  
          return convertView;
      }
  
      @Override
      public boolean hasStableIds() {
          return false;
      }
  
      @Override
      public boolean isChildSelectable(int groupPosition, int childPosition) {
          return true;
      }
  
  }
  </code></pre>
  
  <p>The <strong>main layout</strong>:</p>
  
  <pre><code>&lt;RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" &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;/android.support.v4.widget.DrawerLayout&gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
      &lt;/FrameLayout&gt;
  
       &lt;!-- android:layout_gravity="start" tells DrawerLayout to treat
           this as a sliding drawer on the left side for left-to-right
           languages and on the right side for right-to-left languages.
           The drawer is given a fixed width in dp and extends the full height of
           the container. A solid background is used for contrast
           with the content view. --&gt;
      &lt;ExpandableListView
          android:id="@+id/left_drawer"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
          android:divider="#999999"
          android:dividerHeight="1dp"
          android:background="#ffffff"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The <strong>list_group.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:padding="8dp"
      android:background="#CC7A00"&gt;
  
  
      &lt;TextView
          android:id="@+id/lblListHeader"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
          android:textSize="17dp"
          android:textColor="#ffffff" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The <strong>list_item.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="55dip"
      android:orientation="vertical" 
      android:background="#FFCC80"&gt;
  
      &lt;TextView
          android:id="@+id/lblListItem"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textSize="17dip"
          android:paddingTop="5dp"
          android:paddingBottom="5dp"
          android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft" 
          android:textColor="#336699"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The <strong>output</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/htINt.png" alt="Non expanded"></p>
  
  <p><img src="https://i.stack.imgur.com/Pq6SE.png" alt="Expanded"></p>
  
  <p>Please suggest me ways to hide the navigation bar.</p>
  
  <p>You just need to copy paste the codes in a new project if you wanna see the outputs.</p>