title: Android Multiple Threads in Service
body: <p>I want to run multiple threads in service. Like in google doc example:</p>
  
  <p><a href="http://developer.android.com/guide/components/services.html" rel="nofollow">http://developer.android.com/guide/components/services.html</a></p>
  
  <blockquote>
    <p>However, because you handle each call to onStartCommand() yourself,
    you can perform multiple requests simultaneously. That's not what this
    example does, but if that's what you want, then you can create a new
    thread for each request and run them right away (instead of waiting
    for the previous request to finish).</p>
  </blockquote>
  
  <p>How I can perform multiple request simultaneously?</p>
  
  <p>For example I want 10 threads that starts depend on Message.what.</p>
  
  <p>How and where to create this 10 thread? In <code>OnCreate</code> in service?</p>
  
  <p>But <code>OnCreate</code> exec only once when I create service. But if I want to add threads to service <code>dynamically</code> and <code>generate message</code> depends on <code>intent extras</code>? For example:</p>
  
  <pre><code>Intent intent1 = new Intent(this, SimpleService.class);
  intent1.putExtra("what", 1);
  Intent intent2 = new Intent(this, SimpleService.class);
  intent2.putExtra("what", 2);
  ...
  startService(intent1);
  startService(intent2);
  ...
  </code></pre>
  
  <p>And I should to create 10 handlers and 10 looper for each threads?</p>
  
  <p>Thank You!</p>