title: How to store value in Shared Preferences when user quits from application?
body: <p>How to store value in Sharedpreferences when user quits from my application?</p>
  
  <p>I have tried this code but it's not working for me:</p>
  
  <pre><code>@Override
  protected void onDestroy() {
      // TODO Auto-generated method stub
      //enter code here
      super.onDestroy();
      editor.putString("Check_activity", "true");
      editor.commit();
  }  
  </code></pre>