title: Using a DrawerLayout along with a ListView
body: <p>I'm trying to write an android app with a listview of a few different items and also a drawerlayout that you can drag from the left side of the screen. Here's what i mean....</p>
  
  <p>This is what the main screen looks like:
  <img src="https://i.stack.imgur.com/ugRRg.png" alt="enter image description here"></p>
  
  <p>And here's what the drawer menu thing looks like:
  <img src="https://i.stack.imgur.com/9ZLPi.png" alt="enter image description here"></p>
  
  <p>The problem i'm having is that when I open the side drawer menu thing and tap an option it doesn't work and the menu just closes. However i'm able to interact with the main listview page. Here's what my code looks like:</p>
  
  <pre><code>String[] homeArray = { "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test" };
  
  private ListView homeListView;
  private ArrayAdapter arrayAdapter;
  
  
  
  private DrawerLayout mDrawerLayout;
  private ListView mDrawerList;
  private ActionBarDrawerToggle mDrawerToggle;
  
  private CharSequence mDrawerTitle;
  private CharSequence mTitle;
  private String[] mDrawerTitles;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
  
      mTitle = mDrawerTitle = getTitle();
      mDrawerTitles = getResources().getStringArray(R.array.Menu);
      mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
      mDrawerList = (ListView) findViewById(R.id.left_drawer);
  
      // Set the adapter for the list view
      mDrawerList.setAdapter(new ArrayAdapter&lt;String&gt;(this,
              R.layout.drawer_list_item, mDrawerTitles));
  </code></pre>
  
  <p>And the activity_main.xml:</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      &gt;
  
  &lt;FrameLayout
      android:id="@+id/content_frame"
      android:layout_height="match_parent"
      android:layout_width="match_parent" /&gt;
  
  &lt;ListView
      android:id="@+id/left_drawer"
      android:layout_height="match_parent"
      android:layout_width="240dp"
      android:layout_gravity="start"
      android:choiceMode="singleChoice"
      android:divider="@android:color/darker_gray"
      android:dividerHeight="1dp"
      android:background="#111"
      /&gt;
   &lt;LinearLayout 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:orientation="vertical"
                tools:context=".ListActivity" &gt;
  
  &lt;ListView
          android:id="@+id/homeListView"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  &lt;/ListView&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>I have a feeling the problem is in the xml but i'm not sure. </p>