I am trying to replace the Fragment with a new fragment. For this, I used the following code.
transaction.replace (R.id.fragment_container, newFragment);
But when viewed in AVD, it is not actually replaced. newFragment (which is smaller) is displayed on top of the old_fragment.
However, when accessing old_fragment again, it returns null.
I even tried
Fragment oldFragment =. GetFragmentManager () findFragmentById (R.id.home_fragment); transaction.remove (oldFragment);
Even this is not a visual removal of a fragment.
Could you help me in removing any fragment.
PS: I use the Android compatibility package and create it for Android 2.2.
Nitin source share