4

I have an intent service in my Android app that is scheduled to start every one minute. Let me call this intent service intentServiceA.class

Now I want to use another intentService (intentServiceB.class) for specific tasks.

My question is:

Does intentServiceB goes in the same thread of intentServiceA? Does it goes in the queue? or perform separately?

If it goes in the same thread, what is a good alternative?

Thank you for your help.

user1851212
  • 691
  • 1
  • 7
  • 19

1 Answers1

4

intentServiceA and intentServiceB will create separate threads. In other words Intents sent to intentServiceA are processed sequentially in one thread and Intents sent to intentServiceB are processed sequentially in another thread.

Okas
  • 2,664
  • 1
  • 19
  • 26
  • 1
    do you have any idea if I have a queue of tasks, if I can change priority (change to top in the queue)? – user1851212 Sep 10 '14 at 13:31
  • 1
    Not with the IntentService. – Okas Sep 10 '14 at 13:40
  • 1
    You can use ExecutorService with PriorityBlockingQueue. See http://binkley.blogspot.fr/2009/04/jumping-work-queue-in-executor.html for an example. – Okas Sep 10 '14 at 13:47