Skip to content

Commit

Permalink
Merge pull request Catrobat#3362 from 84n4n4/CATROID-379
Browse files Browse the repository at this point in the history
CATROID-379 media download dialog update progress crashes
  • Loading branch information
wslany authored Oct 11, 2019
2 parents 11922cf + 8c6f4e8 commit 0793a57
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,18 @@ public void createProgressDialog(String mediaName) {
progressDialog.setProgress(0);
progressDialog.setMax(100);
progressDialog.setProgressNumberFormat(null);
progressDialog.show();
if (!isFinishing()) {
progressDialog.show();
}
}

public void updateProgressDialog(long progress) {
if (progress == 100) {
progressDialog.setProgress(progressDialog.getMax());
setResult(RESULT_OK, resultIntent);
progressDialog.dismiss();
if (progressDialog.isShowing() && !isFinishing()) {
progressDialog.setProgress(progressDialog.getMax());
setResult(RESULT_OK, resultIntent);
progressDialog.dismiss();
}
finish();
} else {
progressDialog.setProgress((int) progress);
Expand Down

0 comments on commit 0793a57

Please sign in to comment.