Turn fragment on/off in the onResume()