I\'m having some trouble setting up my custom header in my list.
I\'m creating a ListFragment with a custom adapter. I have the list working fine, but I\'m trying t
As short solution that worked for me:
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
View headerView = getActivity().getLayoutInflater().inflate(R.layout.header, null);
getListView().addHeaderView(headerView);
ArrayAdapter mAdapter = createAdapter(); // create here your own adapter
setListAdapter(mAdapter);
}
@Override
public void onDestroyView() {
super.onDestroyView();
setListAdapter(null);
}