I have added a view to the header of my ListView by following way:

        ListView lv = (ListView)getListView();
        View TopSearch =  (View) View.inflate(this, R.layout.search,
null);
        lv.addHeaderView(TopSearch, null, false);

And everything is fine until I make changes to data adapter and then
try to execute:

       adapter.notifyDataSetChanged();

This always crashes my application giving me following error:

"java.lang.ClassCastException: android.widget.HeaderViewListAdapter"

If I don't add header view to my list view, then everything works fine
with no errors
Any suggestions?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to