Hi Praween,
When you defined a ListView, you have two components for layouts.
You have :
- The layout of the ListView itself
This layout lets you define what to display when the list is empty or filled. Please notice below the android:id="@+id/android:list"
and android:id="@+id/android:empty"
that allow you to decide what to display. Here an example :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="8dp"
android:paddingRight="8dp">
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:layout_weight="1"
android:drawSelectorOnTop="false"/>
<TextView android:id="@id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF0000"
android:text="No data"/>
</LinearLayout>
This layout will define how each entry will be display. This is what - according to me - you are insterested of. For example if you want two informations within an entry your layout for entries will look like this :
<?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="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/text1"
android:textSize="16sp"
android:textColor="#99FFFFFF"
android:layout_width="fill_parent"
android:layout_height="20px"/>
<TextView android:id="@+id/text2"
android:textSize="13sp"
android:textColor="#FFFFFF"
android:layout_width="fill_parent"
android:layout_height="20px"/>
</LinearLayout>
So now you just have to modified the last example layout and manage it the way you want.
Hope I could help, if you need more informations do not hesitate.