"Back" button / connect to PhoneGap, so that the "are you sure you want to leave the app" alert will be effective.
Oh, and hide the loader if the user chose not to close the app.