I press the navigation drawer, then if I press back button, the app exits rather than returning to the previous activity. If I change the xml file, then this problem doesn\'
This will close the drawer when it's open and back is pressed rather than taking you back to the previous activity (or exiting).
DrawerLayout drawer...
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
if(drawer.isDrawerOpen(Gravity.LEFT)){
drawer.closeDrawer(Gravity.LEFT);
}else{
super.onBackPressed();
}
}