1

I understand that IntentServices allow running tasks on worker threads, however is the worker thread only spawn on call back to onHandleIntent?

Is the onCreate() called on the main thread and any object creation that takes place in the onCreate also takes place on the main thread?

Kevin
  • 11
  • 2

1 Answers1

4

Yes, onCreate() runs on the main thread.
If you print out the thread name in onCreate(), you get the following:

Thread[main,5,main]

However, you can spawn off background thread inside onCreate() if you don't want to block the main thread.

david m lee
  • 2,547
  • 26
  • 14