In my app I make use of a background service to do some background data fetching. I launch the service using
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
mConnection is instance of ServiceConnection.
In service I keep fetching some data and validate it, and if the check passes I play a sound.So when this happens user can press a STOP button on activity screen.This would call unbind(mConnection),which would destroy the service wherein I stop the sound. My query is that while service is running in background, and meanwhile Android kills the activity then how would user be able to stop the service.I need mConnection to unbind the service and I can't store mConnection in Bundle in onSaveInstanceState.