Hello, how are you? I'm doing a fragment that goes server as a sort of menu cards in the initial interface. I have made it every time the app opens It creates this interface inside a ConstrainsLayout, however when I open it and click back it disappears and only gets the bottomNavBar and the Constrains empty ...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bottom_nav_bar);
cardButtonID = (CardView) findViewById(R.id.cardButtonID);
animationMenu();
//chamando a UI
if (savedInstanceState == null){
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.addToBackStack(null);
fragmentTransaction.add(R.id.mainViewId, new MainPageFragment());
fragmentTransaction.commit();
}
}