0
Hello, I have an app, it comes down to: a Activity and a fragment. To activity calls the fragment through the onCreate:
Code of Activivity who calls the fragment:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mensagem);
chamaSecondActivity();
}
public void chamaSecondActivity() {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.containerMensagem, new SecondActivity());
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
I would like when you return from Fragment the app closes and does not return to Activity.