I am using following layout(header.xml) to add header in a listview,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/greetingContainer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/categoryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="header view"
android:textColor="#FFFFFF"
android:textSize="15sp" />
</LinearLayout>
and on the other side, i am using,
View header = (View) getLayoutInflater().inflate(R.layout.header,null);
getListView().addHeaderView(header);
when the list is empty it's not working, stays invisible..
my question may be the duplicate of this, but unable to understand,
please help!