title: onBackPressed method is not working properly
body: <p>In my app there is one <code>EditText</code>. I have called keypad show on my activity for this <code>EditText</code>. keypad showing &amp; working fine. </p>
  
  <p>Now in currently, I have to press back button two time, one for hiding keypad &amp; another for performing some task(like data saving to DB).<strong>I don't want to press back button two times.</strong></p>
  
  <p>please guide me, or suggestion  </p>
  
  <p>here some from <code>onBackPressed()</code></p>
  
  <pre><code>@Override
  public void onBackPressed() {
      // TODO Auto-generated method stub
      super.onBackPressed();
  
      hideKeypad();
  
      //saving EditText data to db.
  }
  </code></pre>
  
  <p>code form <code>hideKeypad()</code></p>
  
  <pre><code>private void hideKeypad() {
         InputMethodManager imm = (InputMethodManager) 
          getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.hideSoftInputFromWindow(edittext1.getWindowToken(), 0);
  }
  </code></pre>