Android application reload

I am trying to restart the application when a crash occurs in android using Thread.UncaughtExceptionHandler . Can I restart the application with the current activity stack as a new process? If so, how can I do this?

+7
source share
2 answers

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

 public class MyActivity extends Activity { @Override public void onPause() { finish(); } 
+1
source

As far as I know, as soon as you kill your process, the garbage collector will start, and all objects belonging to your application that consume memory will be freed, that is, all objects will have a zero value. Thus, starting an application with a previous trace of a process loop is not possible.

0
source

All Articles