ListView想要加入headerview的话,就要通过addHeaderView这种方法,然后想要为ListView设置数据的话,就要调用setAdapter方法了.可是,在调用addHeaderView和setAdapter的顺序上,有时会爆出java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.的异常.这是由于我们在addHeaderVie…
ListView想要添加headerview的话,就要通过addHeaderView这个方法,然后想要为ListView设置数据的话,就要调用setAdapter方法了.但是,在调用addHeaderView和setAdapter的顺序上,有时会爆出Java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.的异常.这是因为我们在addHeaderVie…