title: Custom empty view in ListView android
body: <p>I want to show a refresh Button and a TextView if there is no data in the ListView adapter. I also want to be able to add a click listener to the button that will reload the list. Here is how I have my current activity defined:</p>
  
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.foods);
  
      arrList=new ArrayList&lt;FoodsData&gt;();
  
      listView=(ListView)findViewById(R.id.list_foods);
  
      this.listView.setEmptyView(findViewById(R.id.emptyView));
  
      .....
      .....
  }
  </code></pre>
  
  <p>Here is my xml file:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:layout_height="match_parent"&gt;
  &lt;LinearLayout 
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_centerInParent="true"
      android:id="@+id/emptyView"&gt;
      &lt;TextView
          android:layout_width="wrap_content"
          android:textColor="@android:color/white"
          android:layout_height="wrap_content"
          android:textSize="20sp"
          android:text="Click Refresh to load data"/&gt;
     &lt;Button 
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/btn_retry"
          android:textColor="@android:color/white"
          android:background="@drawable/orange_button_selecter"
          android:layout_gravity="center"
          android:textSize="25sp"
          android:text="@string/retry"/&gt;
  &lt;/LinearLayout&gt;
  &lt;ListView 
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:dividerHeight="2dp"
      android:id="@+id/list_foods"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Where would I set the click listener for my refresh Button?</p>