title: Keep me logged in CheckBox Android
body: <p>I am creating an android app for which I have created login and signup pages.
  I want to implement the "keep me logged in" functionality in the login page.
  I think I know what to do but almost anything I try is giving an error.</p>
  
  <p>I have to store the state of checkbox in a SharedPreference and then use it with an if else statement, if it is checked it will skip the login activity and start the main activity, otherwise the login activity.</p>
  
  <p>It would be helpful if someone could provide a sample code.</p>
  
  <pre><code>ChechBox keeplog = (CheckBox)findBiewById(R.Id.checkbox1)
  </code></pre>
  
  <p>How can I store the check state in Shared Preference and how to fetch its state in the form of boolean or string so that it can be used with if-else statement? </p>