I want to know whether my app has crashed or exited by the user. Is there any way to do so?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See this: https://developer.android.com/reference/java/lang/Thread.html#setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler), it may help 🙂
There’s no such thing as exiting the application by the user. You can always do something when onStop() or onBackPressed() of your main activity is called, but that’s all. Just note that it doesn’t mean that the app was “exited”, but only “left” by the user. You can of course finish the activity from there to make sure the app is really exited.