I'm done quite a few fragments before but they were all extending some existing fragment and now it's a quite/dirty testing where I'm just setting list fragment and its adapter but I want to get rid of this annoyance that is happening and would like to know what's the best way.

here's my onCreate of my FragmentActivity:

```
    @Override
    protected void onCreate(Bundle savedInstances) {
    super.onCreate(savedInstances);
    mListFrag = new ListFragment();
    getSupportFragmentManager().beginTransaction().add(android.R.id.content, mListFrag).commit();
    getSupportLoaderManager().initLoader(13, null, this).forceLoad();
    }

```

simple stuff, instantiate a new ListFragment, add it as the main frame of my activity and start my cursor loader.

On the cursor loader, when it's done:

```
    @Override
    public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {

    if (mAdapter == null) {
        mAdapter = getCallLogCursorAdapter(cursor);
        mListFrag.setListAdapter(mAdapter);
    } else {
        Cursor oldCursor = mAdapter.swapCursor(cursor);
        if (oldCursor != null)
        oldCursor.close();
    }
    }

```

again, simple stuff, create an adapter if necessary, if not I just swap the curso.

All this works fine on the first run, but when I rotate the device, I got the rotate list plus a progress bar on the middle of my view. It seems that somehow there's two fragments one on top of the other. I tried making `mListFrag.setRetainInstance(true);` it won't show the progress bar but then there's still two fragments one on top of the other, one that receives the touches scrolling through the list and other that stays static.

I'm not overriding any other of the activities onSomething() callbacks.

I'm not bothering doing much elaborate way cause I'm testing the data-side of the app and that's just to quick see if the DBs/loaders/content providers are all working fine. The UI haven't even been though.

any ideas??

**edit:**

I've seen a different question to use the replace instead of add on the fragment and it kind of worked but not really. It solves all the problems inside the fragment itself, but when I click back and it goes to the previous activity, guess? the indeterminate progress bar is there on the middle of an activity that has nothing to do with those list fragments.

ideas? Maybe I should just stick this fragment in a layout xml, but because it is test I was avoiding creating resources for them.