Empty text view message when listview is empty
- by Blid Tounsi
I have a ListView with an empty list catch in the XML and it works fine. How to toggle ListView Empty Text please ?
This is my XML code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/empty"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/emptyList" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
I'm not using a ListActivity. It s possible to do that please ?