Reputation: 21076
Is it possible, with an IntentService, to send another intent to the IntentService from within the IntentService?
For example, say my IntentService is processing an Intent which has it write a bunch of data to the database. During this time, several other Intents to write other data may [or may not] have been queued up in the IntentService. Suppose, after processing that Intent by writing the data to the application's database, I want to queue up another Intent to send that data via web service to "the cloud." Perhaps I want to queue this processing in another Intent because sending to the cloud is secondary.
Is it possible? Would it cause any problems if the Intent being processed is the only Intent in the queue at the time the IntentService is trying to queue another Intent?
Upvotes: 0
Views: 1040
Reputation: 21076
I've tested this out and it seems to be a bad idea. My first Intent is being processed over and over and over and over indefinitely
Upvotes: 0
Reputation: 1006799
I am not aware of any problems here. Internally, IntentService
just uses its own thread, Looper
, and Handler
for the queuing work.
Upvotes: 1