title: How to call onBackPressed in MainActivity which extends Fragment in android?
body: <p>I am developing an app in which <code>MainActivity</code> extends Fragment. Here is I need to call <code>onBackPressed</code> for some usage. How can I achieve this?</p>
  
  <p>I used below code which does not worked</p>
  
  <pre><code>class MainActivity extends Freagment{
  .
  .
  .
  .
  
  Override
  public void onBackPressed() {
      super.onBackPressed();
  }
  }
  </code></pre>
  
  <p>The previous page is just like this</p>
  
  <pre><code>class LoadWebData extends Activity
  {
  .
  .
  .
  }
  </code></pre>