So I have an app with just a few Activities and many fragments that are being replaced into the MainActivity layout. This is pretty straight forward.
FragmentManager fragmentManager = fragment.getFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); MyFragment f = MyFragment.newInstance(); transaction.replace(R.id.container, f); transaction.addToBackStack(null); transaction.commit(); When MainActivity extends Activity, everything works just fine. But I changed this to ActionBarActivity, in order to implement Toolbar, and suddenly the backstack does Activities only.
The strange thing is, on Android 4.x it still works. On 5.x, the Fragments are skipped.
Any ideas?