title: Onbackpressed in fragment not working while implementing interface
body: <p>I am trying to override onbackpressed method inside fragment . But it gives me syntax error that it should override a super method in interface. Why so? I have other methods like ondestroy also in my fragment class but no error. Why for this backpressed alone. I tried onkeydown also. Same error. Pasting below my code.</p>
  
  <pre><code>  public TestClass extends Fragment implements    Testinterface
  {  @Override //error must override or implement    supertype method
   public void onBackPressed ()
  {
   if (check)
  Do somethin
   else
    getActivity().finish ()
    //super.onBackPressed () // error here if I use this
    }
  </code></pre>