title: When i press a back button on my first fragment, the app should exit
body: <p>I used the below code to bring back the home screen fragment from next fragment by  pressing back button. Now i want to know how to exit from the app when i click back button from home fragment.</p>
  
  <pre><code>   public void onBackPressed() {
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.replace(R.id.container, homefragment, LearnSourastraUtils.HOME_FRAGMENT_TAG);
        ft.commit();
      }
  </code></pre>