title: How to set a toolbar in a List Activity?
body: <p>I want to change the app I have created so far, in order to implement a <code>ListView</code>. I followed <a href="http://androidexample.com/Create_A_Simple_Listview_-_Android_Example/index.php?view=article_discription&amp;aid=65&amp;aaid=90" rel="nofollow">this example</a> and <a href="http://www.mkyong.com/android/android-listview-example/" rel="nofollow">this example</a>. The examples alone work, but not together with the changes I had to make to my so-far existing app. </p>
  
  <p>I have a <code>avticity_main.xml</code> defined as follows:</p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context=".MainActivity" &gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"/&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/main_grid"
  
          android:useDefaultMargins="true"
          android:alignmentMode="alignBounds"
          android:columnOrderPreserved="false"
  
          android:columnCount="4"
          &gt;
  
          &lt;TextView
              android:text="MainTitle"
              android:textSize="32dip"
              android:layout_columnSpan="4"
              android:layout_gravity="center_horizontal"
              android:id="@+id/textView1"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
          &lt;ListView
              android:id="@+id/list"
              android:layout_height="wrap_content"
              android:layout_width="match_parent"&gt;
          &lt;/ListView&gt;                            
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>and I have the following code for my main activity: </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity  {
      static final String[] MOBILE_OS =
          new String[] { "Android", "iOS", "WindowsMobile", "Blackberry"};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_main);
  
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          ListView list = (ListView) findViewById(R.id.list);
          list.setAdapter(new ListAdapter(this, MOBILE_OS));
  </code></pre>
  
  <p>The code compiles fine, but no list is shown. </p>