Search code examples
androidandroid-listviewandroid-fragmentsandroid-listfragment

adding footer to one of the ListFragments' listview automatically adds footer to another one


So my app consists of two ListFragments. Lets call them ContentsList and TextList. The problem is when I am adding a footer to the ListView of ContentsList like this (in the onActivityCreated() method:

lv = getListView();
v = getActivity().getLayoutInflater().inflate(R.layout.add_new,
                null);
lv.addFooterView(v);

It would automatically add a footer to a listview of the TextList ListView as well. Any idea why this might be happening?


Solution

  • Uhu solved.

    The problem was that one of my fragments was actually called "ListFragment" and at some point my fragment and the actual class ListFragment were confused and it caused a problem.

    I took this idea from this tutorial but it seems that that guy has already tweaked it for the better. Anyway I shall punch him in the face on the first occasion.