The Android documentation says the following about IntentService:
[IntentService] creates a work queue that simultaneously passes one intention to your onHandleIntent () implementation, so you donβt have to worry about multithreading.
But in the following example, they use a synchronized block in the onHandleIntent method, as if it was expected to be executed simultaneously.
protected void onHandleIntent(Intent intent) { synchronized (this) { Some operations... } }
Why are they using sync here? Did I miss something?
source share