Search code examples
gwtmvp

Does Activity.onStop() get called when the tab closes or refreshes?


I thought I saw somewhere that GWT's Activity onStop() method allowed the app to react to page closing. However, in an experiment, this appears not to be the case. Is it supposed to work this way, or am I doing something wrong?


Solution

  • It's the method mayStop(), which is called when the Activity is closed or the page is closed. If you return a non null string it will be displayed in a window.confirm box where the user can dismiss leaving the activity or page.