title: Loop to change Boolean to false after time?
body: <p>This should be very simple but I can't seem to work it out.</p>
  
  <p>I want to create a method which will return a boolean false value after a period of time once called.</p>
  
  <p>I have tried for, while and switch statements but none have the desired affect.</p>
  
  <p>REASON: I have an on touch event which which changes a boolean value to activate a game state. I want this value to change back to false after a period of time to avoid the user holding the the touch event to keep the game state indefinitely.</p>
  
  <p>I have tried the below method in my game loop to change the value back false after a period of time. This will be called at the same time as the state activate method is called.</p>
  
  <pre><code>private void stateCounter() {
       int count = 100;
         for (int i =0; i &lt; count ; i++) {
         stateBoolean = true;
         }
         stateBoolean = false;
  
  }
  
  
  
  private void stateCounter() {
       int count = 1;
         while (count &lt; 100) {
         stateBoolean = true;
         count++;
         }
         stateBoolean = false;
  
  }
  </code></pre>
  
  <p>What is the best way to do this?</p>