FATAL EXCEPTION: main java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.
I got this crash, but It didn't always happen! Actually my test phones have no problem. below is my codes.
Constructor
public MyListView(Context context) {
super(context);
adapter = new MytListAdapter(context);
setAdapter(adapter);
}
and I called 'addHeaderView' after getting data from server. so I tried calling addHeaderView before setAdapter and I using visibility of attribute of view. but even if i set the view gone, but it still has a space.
any idea to solve this?