Sometimes we want to add or remove a fragment after the adapter has been set. This is ok on Kit-Kat but if we are working with compatibility libraries to support earlier versions of Android we can use this to guaranty that the internal ListView
wraps the adapter in a HeaderViewListAdapter
.
This example show how this can easily handled. The same logic can be used with a stand alone ListView
in a custom layout.