16.09.2010 20:21, Bret Foreman пишет:
According to the profiler, the onStartCommand method of the
IntentService is running on the main thread, not in a worker thread.
Any idea what could cause this behavior?
This is correct - onStartCommand is a framework method that exists in any service, and so is called by the framework on the UI thread. Same as with any service.

The IntentService-specific worker method is onHandleIntent:

http://developer.android.com/reference/android/app/IntentService.html#onHandleIntent(android.content.Intent)

this is called on the worker thread.

Make sure you don't override onStart / onStartCommand, or call the superclass. It's these methods in IntentService that dispatch the intent to the worker thread, and, ultimately, to onHandleIntent.

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to