title: Android: set empty view to a list view
body: <pre><code> &lt;TextView
              android:id="@android:id/empty"
              style="@style/FacebookFont"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center_horizontal"
              android:text="@string/no_result_found"
              android:textColor="@color/white" /&gt;
  </code></pre>
  
  <p>this is the xml code for empty view. I am setting empty view as follows:</p>
  
  <pre><code>    list.setAdapter(adapter);
      list.setEmptyView(findViewById(android.R.id.empty));
  </code></pre>
  
  <p>I have the items in the listview even then also before listview is populated the empty view is shown. 
  I don't want that empty view to be shown when listview contains some item.</p>
  
  <p>Please help.</p>