In my ListActivity I’m trying to add a Header with single text.
I tried with the Layout and add with addHeaderView – success
But it requires Inflater and have to create a layout-xml
I cast the TextView to View Object
View v=(View)myTextView;
Then pass it to addHeaderView
myListView.addHeaderView(v);
I failed.
Is that possible to cast the textview ?
It shows only runtime error
Just pass the textView directly, no need to cast.
You can create a textView runtime and pass it to the headerView, but you cannot use an existing textView.