Empty text view message when listview is empty
Posted
by
Blid Tounsi
on Stack Overflow
See other posts from Stack Overflow
or by Blid Tounsi
Published on 2013-10-21T15:14:35Z
Indexed on
2013/10/21
15:54 UTC
Read the original article
Hit count: 282
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 ?
© Stack Overflow or respective owner