File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
simpledialogfragments/src/main/java/eltos/simpledialogfragment Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1616
1717package eltos .simpledialogfragment ;
1818
19+ import android .os .AsyncTask ;
1920import android .os .Bundle ;
2021import android .text .TextUtils ;
2122import android .view .View ;
@@ -282,13 +283,21 @@ public void updateFinished(){
282283 setPositiveButtonEnabled (true );
283284 setNeutralButtonEnabled (false );
284285 if (getArgs ().getBoolean (AUTO_DISMISS )){
285- dismiss ();
286+ dismissAllowingStateLoss (); // ok to fail if stopped, will dismiss in onResume
286287 callResultListener (COMPLETED , new Bundle ());
287288 }
288289 }
289290 }
290291
291-
292+ @ Override
293+ public void onResume () {
294+ super .onResume ();
295+ if (getArgs ().getBoolean (AUTO_DISMISS )) {
296+ if (mTask != null && mTask .getStatus () == AsyncTask .Status .FINISHED ) {
297+ dismiss ();
298+ }
299+ }
300+ }
292301
293302 /**
294303 * Set or update the progress text at the start of the progress bar /
You can’t perform that action at this time.
0 commit comments