I\'m using the built-in navigation drawer to run my app. I can\'t quite figure out how to handle the back button. When it\'s pressed I want it to load the very first fragmen
Just wanted to report my findings even though this question is a little old for anyone else who may have had the same problem with the accepted answer. For me, doing the method suggested in the accepted answer, made the layers overlap, quickly making them unreadable. The code below (adapted from the accepted answer) avoids the overlaying but still adds the screen to the back stack.
fragmentManager.beginTransaction().replace(R.id.container, fragment).addToBackStack("fragBack").commit();