I manage two fragments in my MainActivity.
One of them is a subclass of ListFragment to show a list of items.
The main idea is to navigate to another list view when user tap one of the items, and the user can go back to the previous list view when tapping back button.
The code for transmit to a new list is shown as follow:
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
NewFragment newFragment = new NewFragment();
newFragment.setArguments(getIntent().getExtras());
transaction.replace(R.id.fragment_layout, newFragment);
transaction.addToBackStack(null);
transaction.commit();
However, I just simply exit the application other than going back to the previous view. What am I doing wrong?