I have a Main activity and I am launching a fragment from it. However when fragment is launched it also shows the layout of the main activity.
what is the best way to stop it? I don't need to save its state it can be relaunched once fragment is closed.
This is how am launching it
FragmentManager fragmentManager = getSupportFragmentManager();
android.support.v4.app.FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.container, fragment);
fragmentTransaction.addToBackStack("");
fragmentTransaction.commit();