title: Including navigation drawer to all activities
body: <p>Hi I'm trying to include the navigation drawer to all activities in my app. But I'm getting error as the code must contain the id as android.R.id.list. This is my code. What I exactly need is to include the drawer layout to all other activities. I googled a lot and tried with many samples but nothing helped me.</p>
  
  <p>Base Class</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
  
      setContentView(R.layout.activity_main1);
      super.onCreate(savedInstanceState);
  
  
  }
  @Override
  public void setContentView(int layoutResID) {
  
      mDrawerLayout = (DrawerLayout) getLayoutInflater().inflate(R.layout.activity_main1, null);
      mFrameLayout = (FrameLayout) mDrawerLayout.findViewById(R.id.content_frame);
  
      getLayoutInflater().inflate(layoutResID, mFrameLayout, true);
  
      super.setContentView(mDrawerLayout);
  
  }
  </code></pre>
  
  <p>drawer layout 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_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;FrameLayout
      android:id="@+id/content_frame"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&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:divider="@android:color/transparent"
      android:listSelector="@android:color/transparent"
      android:dividerHeight="0dp"
      android:background="#111"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>And my activity to which I need to add the navigation drawer is</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      setContentView(R.layout.main_category);
      super.onCreate(savedInstanceState);
  
  }
  </code></pre>