0

Please could you explain how I can detect when an app is closed? I don't want to use only OnSleep as this is only background running, so it there a method for identifying when an app is exited in contract to the OnStart method?

Does OnDisappearing AND OnAppearing work just the same?

Thanks

Avatar
  • 37
  • 7
  • What do you mean by closed? killed by os? and why do you need that? [lifecycle](https://learn.microsoft.com/en-gb/xamarin/xamarin-forms/app-fundamentals/app-lifecycle) - [How to detect if android app is force stopped or uninstalled?](https://stackoverflow.com/q/16013578/5228202). – Cfun Jun 02 '21 at 21:37
  • Yes i mean kill the app. Well I've created a timer app so I need to know the DateTime the app was killed in order to add the difference when the app is opened... Unless there is any other way to continue a timer, maybe MongoDB side? – Avatar Jun 03 '21 at 11:40
  • If the app process is already killed there is no callback so no way you can execute another command, you could maybe periodically save the timer or https://stackoverflow.com/a/9696962/5228202 – Cfun Jun 03 '21 at 11:53

0 Answers0