I want to implement some sort of a monitor function, that tells me when my app is crashed or stopped or on pause. So I have 3 activities and I achieved so far that when in the mainActivity onPause is called it will send me a mail, however, I only want to know if someone stops the whole app and not just one of the activities (since the user jumps between them). Is there some kind of an overall onStop() Method or something that I can use?
Thanks !
This is my code
protected void onStop() {
super.onStop();
new Thread(new Runnable() {
public void run() {
try {
GMailSender sender = new GMailSender(
"email address",
"pw");
sender.sendMail("Pause", "The app has paused",
"email address",
"email address");
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
}
}
}).start();
}