android - Does code in onHandleIntent block IntentService from receiving other intents? -


I have a IntentService that connects to Bluetooth (blocking part), sends data, And disconnects. I have modified the IntentService to handle a particular purpose that will stop the service. However, it seems that because of the blocked code, which connects to the Bluetooth device (indefinitely or canceled by the user), the override on or the onstart commm will not be called until the code blocking part is now blocked Happening.

Can the code inside other handholds block other intentions reaching the service?

Yes IntentService uses a single worker thread.

Or to accurately cite the documents:

All requests are handled on a single worker thread - they may be as necessary (and The main loop will not be blocked), but only one request will be processed at the same time.

to

This means that only OnStartCommand can be on IntentService at one time.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -