I’m developing an hybrid android application using Cordova 2.2 and I’m wondering if there is way to catch the onDestroy() method that is fired when I force close my application.
I’ve already handle the backbutton event from my app but when someone shut downs the app from the taskbar (draggin out the app window from taskbar) onDestroy() method from my Activity is called. I need to invoke LogOut() method from my javascript functions before shutting down the app.
Does someone knows a plugin which do this?
Thanks
You would need to over ride onDestroy in the class in your app that extends from DroidGap. You’d call super.onDestroy and then send a message to your JavaScript to tell it to log out. No guarantee that this will work considering your app is being killed.