Merge pull request #4024 from ByteHamster/onlinefeedview-error-cancel

Fixed error dialog not closing activity sometimes
This commit is contained in:
H. Lehmann 2020-04-09 12:35:18 +02:00 committed by GitHub
commit fc92802dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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