If you are working with Fragments , then you have a manager for them, so in fact you only need to instantiate these Fragments and replace container as needed.
When creating your Activity
, you can have these two next blocks, with the manager:
FragmentManager fragmentManager = getFragmentManager()
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
And the two Fragments :
CadastroFragment cadastro = new CadastroFragment();
MapaFragment mapa = new MapaFragment();
So just do the transaction when you need it. To register, for example:
fragmentTransaction.replace(R.id.fragment_container, cadastro);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();