title: If app is idle till 10 minutes, how to start from splash screen
body: <p>I want to write javascript code through which a Phonegap app get restarted when it is on idle state till last 10-20 minutes. I am using following code</p>
  
  <pre><code>$('document').ready(function(){
      var idleTime = 0;
      var idleInterval = setInterval(timerIncrement, 60000);
  
      $(this).mousemove(function (e) {
              idleTime = 0;
      });
  
      $(this).scroll(function (e) {
              idleTime = 0;
      });
  
      function timerIncrement() {
  
          idleTime = idleTime + 1;
          if (idleTime &gt; 10) { // 20 minutes
              window.localStorage.removeItem("user_id");
              window.localStorage.removeItem("client_id");
              location.reload();
          }
       }
   });    
  </code></pre>