Cannot add header view to list — setAdapter has already been called

On android 2.3, add header after setAdapter (even if you have added early, then removed) will throw an exception. To hide or show a header dynamically, use setVisibility(). How? You can see Hiding header views.

Leave a Comment