title: Android: Navigation drawer on multiple activities
body: <p>I'm trying to implement a navigation drawer on multiple activities by creating a DrawerActivity that all my other Activities inherit from. </p>
  
  <p>I have used the following 2 links to get me to where I am:</p>
  
  <p><a href="https://developer.android.com/training/implementing-navigation/nav-drawer.html" rel="nofollow noreferrer">https://developer.android.com/training/implementing-navigation/nav-drawer.html</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4922641/sliding-drawer-appear-in-all-activities/4922740#4922740">sliding drawer appear in all activities</a></p>
  
  <p>I can see the navigation drawer (grab handle), however I cannot open it from the clicking the title in the action bar nor can I see any items in the drawer. I can, however, open it from sliding across.</p>
  
  <p>DrawerActivity.java</p>
  
  <pre><code>public class DrawerActivity extends Activity {
  
      private DrawerLayout mDrawerLayout;
      private ListView mDrawerList;
      private ActionBarDrawerToggle mDrawerToggle;
      private String[] navOptions = new String[] {"Collect Offers", 
          "Exclusive", "Glove Box", "Servicing", "Dealer", "Settings"};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_drawer);
  
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mDrawerList = (ListView) findViewById(R.id.nav_drawer);
  
          mDrawerList.setAdapter(new ArrayAdapter&lt;String&gt;(
              this, R.layout.drawer_list_item, navOptions));
  
          mDrawerToggle = new ActionBarDrawerToggle(
                  this,
                  mDrawerLayout,
                  R.drawable.ic_drawer,
                  R.string.drawer_open,
                  R.string.drawer_close
          ) {
  
              public void onDrawerClosed(View view) {
                  super.onDrawerClosed(view);
                  getActionBar().setTitle(R.string.app_name);
              }
  
              public void onDrawerOpened(View drawerView) {
                  super.onDrawerOpened(drawerView);
                  getActionBar().setTitle(R.string.app_name);
              }
          };
  
          mDrawerLayout.setDrawerListener(mDrawerToggle);
  
          getActionBar().setDisplayHomeAsUpEnabled(true);
          getActionBar().setHomeButtonEnabled(true);
  
      }
  
      @Override
      protected void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
          mDrawerToggle.syncState();
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
          mDrawerToggle.onConfigurationChanged(newConfig);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          if (mDrawerToggle.onOptionsItemSelected(item)) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      public void setContentView(final int layoutResID) {
          DrawerLayout fullLayout = (DrawerLayout) getLayoutInflater()
              .inflate(R.layout.activity_drawer, null);
          LinearLayout actContent = (LinearLayout) fullLayout
              .findViewById(R.id.content);
          getLayoutInflater().inflate(layoutResID, actContent, true);
          super.setContentView(fullLayout);
      }
  }
  </code></pre>
  
  <p>activity_drawer.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/content"
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@drawable/infiniti_splash_2x"&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ListView android:id="@+id/nav_drawer"
          android:layout_width="@dimen/nav_drawer_width"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
          android:divider="@android:color/transparent"
          android:dividerHeight="0dp"
          android:background="#111"/&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>HomeActivity.java</p>
  
  <pre><code>public class HomeActivity extends DrawerActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home);
      }
  
      @Override
      protected void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>activity_home.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  &lt;/LinearLayout&gt;
  </code></pre>