title: How to store a boolean value using SharedPreferences in Android?
body: <p>I want to save boolean values and then compare them in an if-else block.</p>
  
  <p>My current logic is:</p>
  
  <pre><code>boolean locked = true;
  if (locked == true) {
      /* SETBoolean TO FALSE */
  } else {
      Intent newActivity4 = new Intent(parent.getContext(), Tag1.class);
      startActivity(newActivity4);
  }
  </code></pre>
  
  <p>How do I save the boolean variable which has been set to false?</p>