title: set OnBackPressed in Fragment
body: <p>I am having 4 fragments.They are consists of HomeFragment, Rainfall, rainday, and yieldFragment.
  If right now i am on Rainfall fragment, then i press backbutton, 
  i want the fragment will come back to Home fragment(as a default). 
  But right now my applicaton situation is when press backbutton, 
  the application was closed. I've tried by using onBackpressed, but i think my onBackPressed was not work properly.  </p>
  
  <p>What should i do for this situation..?Please anyone can answer.
  i've tried this...</p>
  
  <pre><code>  public void onBackPressed() {
  
          fragment=new HomeFragment();}
  </code></pre>
  
  <p>Please help me if anyone knows.</p>