Search code examples
androidandroid-fragmentsandroid-activityandroid-listfragment

Working with two fragments


There are two fragments. However it is slightly different from the tutorials case when there is one ListFragment and one DetailFrament, because I have two ListFragments. Now the problems is when I use this in one fragment :

getListView().addFooter(someView);

It would automatically assign this footer (or header) to another fragment as well, because getListView() method "Gets the activity's list view widget" and my two ListFragments are both in the main activity.

Any ideas how to get around it???


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.