- From your activity, call
startService(intent)
and pass it some data representing a key to stop the service. - From your service, call
stopForeground(true)
- and then
stopSelf()
right after it.
startService(intent)
and pass it some data representing a key to stop the service.stopForeground(true)
stopSelf()
right after it.