I have a regular Android ServiceConnection
:
I'm overriding the onServiceDisconnected()
method like so:
private ServiceConnection myConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
}
@Override
public void onServiceDisconnected(ComponentName name) {
System.out.println("MyTag why are you not getting called");
}
};
and the service is binded and started just fine. i intentionally crash the app after some time after the service is connected; however, the onServiceDisconnected
is never called - why is that? according to the documentation, this is supposed to get called whenever an app crashes...
the thing that i'm trying to accomplish is this:
suppose the user just flat out kills the process/ or accidentally runs into a crash, i want certain things to happen (like... cancelling a notification... which is what i currently do in the activity's onStop()). but where should i cancel the notification from? well also to disconnect service if the app crashed?