can someone explain me why SyncService is destroyed exactly after 120 seconds after it is created?
Also strange thing is that SyncAdapter method onPerformSync is still running after SyncService is destroyed.
Thanks!
The fact that the function is running after the Service is detroyed is normal. You can't just stop a thread from outside (without knowing a lot about how the thread works). You could break the app, corrupt data, or cause a deadlock. So Android doesn't even try. Destroying the Service just changes some bookkeeping and prevents some things that require a Context from working, it doesn't stop any threads that are running.
Stopping after 120 seconds- sounds like the timer for background services. Did you call startForeground()?