title: Android the difference between onHandleIntent & onStartCommand
body: <p>I am currently writing a android program which needs an <code>IntentService</code>. When I put the code in the <code>onHandleIntent</code> function, the code does not run, but it doesn't give errors in the <code>MainActivity</code>. But when I copy my code into the <code>onStartCommand</code>, it runs perfectly. </p>
  
  <p>The problem is that I wanna know what are the differences between <code>onHandleIntent</code> and <code>onStartCommand</code>. Thanks.</p>
  
  <p>CODE:</p>
  
  <p>In <code>onHandleIntent</code>:</p>
  
  <pre><code>System.out.println("SERVICE STARTED! ! !");
  //System.out.println(intent.getBooleanExtra("once", Boolean.FALSE));
  if (intent.getBooleanExtra("once", Boolean.FALSE)) {
      Check();
  }
  mHandler.postDelayed(mRunnable, 3000);
  </code></pre>