File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
updatepluginlib/src/main/java/org/lzh/framework/updatepluginlib Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1818import android .app .Activity ;
1919import android .app .AlertDialog ;
2020import android .app .ProgressDialog ;
21- import android .content .Context ;
2221import android .content .DialogInterface ;
23- import android .os .Process ;
2422
2523import org .lzh .framework .updatepluginlib .base .DownloadCallback ;
2624import org .lzh .framework .updatepluginlib .base .DownloadNotifier ;
@@ -77,8 +75,7 @@ private void createRestartDialog() {
7775 @ Override
7876 public void onClick (DialogInterface dialog , int which ) {
7977 if (update .isForced ()) {
80- System .exit (0 );
81- Process .killProcess (Process .myPid ());
78+ ActivityManager .get ().exit ();
8279 } else {
8380 dialog .dismiss ();
8481 }
Original file line number Diff line number Diff line change 1919import android .app .Application ;
2020import android .content .Context ;
2121import android .os .Bundle ;
22+ import android .os .Process ;
2223
2324import java .util .LinkedList ;
2425
@@ -92,4 +93,14 @@ void registerSelf(Context context) {
9293 this .applicationContext = context .getApplicationContext ();
9394 }
9495
96+ public void exit () {
97+ Activity activity ;
98+ while ((activity = stack .pop ()) != null ) {
99+ if (!activity .isFinishing ()) {
100+ activity .finish ();
101+ }
102+ }
103+ System .exit (0 );
104+ Process .killProcess (Process .myPid ());
105+ }
95106}
You can’t perform that action at this time.
0 commit comments