Is there a to call a function when you close or reopen the App

Is there a to call a function when you close or reopen the App

Dear All,

I know that even "pagebeforehiden" will call a script when with change of page.

But when I close the application, there si an event for that?

The same when with open it?

Thank and happy new year