I have an Activity with several buttons and text elements. These elements reside in the Activity itself, not inside a fragment.
However, I want to be able to replace all this content with a PreferencesScreen fragment. Is this possible at all without putting the rest of the contents in my Activity that I want removed into a fragment and then call the .replace()
function?
Currently I do
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new ProfileFragment())
.commit();
but this simply puts the ProfileFragment on top of my Activity. It overlays it. So I see and can interact with the ProfileFragment, but I also see the rest of the contents of the Acitvity underneath.
Again: I want to be able to replace all the content of my Activity with a PreferencesScreen fragment. Is this possible at all without putting the rest of the contents in my Activity that I want removed into a fragment and then call the .replace()
function?