Fixed error dialog not closing activity sometimes
This commit is contained in:
parent
12781c9101
commit
9f91a2ab86
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue