title: Navigation drawer doesn't close
body: <p>The navigation drawer in my app is not closing. I am using activities instead of fragments. When i click on any item in the <code>listview</code>, it opens other activities as it should but when i go back, the drawer is still open. I have tried using <code>DrawerLayout.closeDrawers();</code> but it did not work. How do I close the navigation drawer?<br> 
  Here is my code:<br></p>
  
  <p><strong>Java</strong></p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  final String[] data ={"Aluminium","Gold","Zinc"};
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, data);
  
      final DrawerLayout drawer = (DrawerLayout)findViewById(R.id.drawer_layout);
      final ListView navList = (ListView) findViewById(R.id.left_drawer);
      navList.setAdapter(adapter);
      navList.setOnItemClickListener(new AdapterView.OnItemClickListener(){
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, final int pos,long id){
  
              switch (pos){
                  case 0:
                      Intent i = new Intent(MainActivity.this,Aluminium.class);
                      startActivity(i);
                      break;
                  case 1:
                      Intent i2 = new Intent(MainActivity.this,Gold.class);
                      startActivity(i2);
                      break;
                  case 2:
                      Intent i3 = new Intent(MainActivity.this,Zinc.class);
                      startActivity(i3);
                      break;
              }
          }
      });
  }
  }
  </code></pre>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/drawer_layout"
  android:orientation="horizontal"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  &lt;!-- The main content view --&gt;
  &lt;FrameLayout
      android:id="@+id/content_frame"
      android:layout_width="match_parent"
      android:background="#000000"
      android:layout_height="match_parent" &gt;
  &lt;/FrameLayout&gt;
  
  &lt;ListView android:id="@+id/left_drawer"
      android:layout_width="220dp"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:choiceMode="singleChoice"
      android:divider="@android:color/transparent"
      android:dividerHeight="1dp"
      android:background="#000000"/&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>