Fixed error dialog not closing activity sometimes

This commit is contained in:
ByteHamster 2020-04-08 21:09:36 +02:00
parent 12781c9101
commit 9f91a2ab86
1 changed files with 3 additions and 3 deletions

View File

@ -535,14 +535,14 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
} else { } else {
builder.setMessage(R.string.error_msg_prefix); builder.setMessage(R.string.error_msg_prefix);
} }
builder.setNeutralButton(android.R.string.ok, builder.setPositiveButton(android.R.string.ok,
(dialog, which) -> dialog.cancel() (dialog, which) -> dialog.cancel()
); );
builder.setOnCancelListener(dialog -> { builder.setOnDismissListener(dialog -> {
setResult(RESULT_ERROR); setResult(RESULT_ERROR);
finish(); finish();
}); });
if(dialog != null && dialog.isShowing()) { if (dialog != null && dialog.isShowing()) {
dialog.dismiss(); dialog.dismiss();
} }
dialog = builder.show(); dialog = builder.show();