For android service, onCreate()
and onStartCommand()
both run in main thread? OR onCreate runs in main thread and onStartCommand()
runs in background thread spawned by the system itself?
Also putting lengthy tasks in onCreate()
or onStartCommand()
could lead to ANR?
Also incase of START_STICKY
(return value for onStartCommand), intent is not redelivered if service is restarted after being killed. Then in what situations is it exactly useful(Any example)?