Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Restarting the Application

I am trying to restart the app when the crash occurs in android using Thread.UncaughtExceptionHandler. Can i restart the app with current activity stack as a new process?? If yes how can i do it?

like image 592
PgmFreek Avatar asked Jun 05 '12 04:06

PgmFreek


1 Answers

One method is to override the onPause method in the activity to kill the app. Like this:

public class MyActivity extends Activity {
    @Override
    public void onPause() {
        finish();
    }
like image 174
Zaid Daghestani Avatar answered Sep 19 '22 22:09

Zaid Daghestani