-1

When I shut down my android app, I would like to stop an another app.

To realize this behavior, I thought to catch an event (e.g. onDestroy on my activity or my background service) and to send a message to my oher app that signal it to stop.

My problem is that no onDestroy events are triggered.

Is there an event triggered by android when an app is shut down?

1 Answers1

0

It depends on what you want to achieve. If by 'shut down' you mean when user lefts your activity trigger an event in onStop, this gets called every time user closes the activity (not to be confused with pressing home or recents and switching to different app).

If by shut down you mean complete process stop, there are no guarantees that any callback method will be called, especially when process is killed by low memory killer)

darekxan
  • 498
  • 4
  • 9