Fix bugs in ListView

Make addHeaderView and addFooterView be more consistent with each other: they
now both check that there either is no existing adapter, or that the existing
adapter is a HeaderViewListAdapter, and they both call the DataSetObserver
(previously only addHeaderView would check the adapter, and it would only
check that it was null, while only addFooterView would call the DataSetObserver)
Make removeHeaderView and removeFooterView check that the DataSetObserver
is non-null before using it.

Change-Id: I681b87f70aabca63e664ca8d0c1cfc25530e00b9
1 file changed