tags:

views:

184

answers:

2

I start a service in an activity then I want the service to stop itself after awhile.

I called stopSelf() in the service but it doens't work.

how to make the service stop itself? thanks!!!

A: 

Have you tried System.exit(0)?

ruibm
A: 

If by "doesn't work" you mean the process doesn't get killed, then that's how android works. The System.exit(0) or Process.killProcess(Process.myPid()) will kill your process. But that's not the Android way of doing things.

HTH

Jayesh