If you are using fragments, you can switch back to the previous one by adding the transaction to the back stack:
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.container, newFragment);
ft.addToBackStack(null);
ft.commit();