Last active
December 28, 2018 11:58
-
-
Save kyodgorbek/619c67711c79af5f34046c7d0f06defd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void showError(String errorMessage) { | |
if (errorMessage == null || errorMessage.trim().isEmpty()) | |
errorMessage = getString(R.string.default_error_message); | |
AlertDialog dialog = new CustomAlertDialogBuilder(this) | |
.addMessage(errorMessage) | |
.setPositiveButton("OK", DialogInterface::dismiss) | |
.build(); | |
try { | |
if (dialog != null) { | |
dialogs.add(dialog); | |
//Added this line | |
if(!isFinishing()) | |
dialog.show(); | |
} | |
} catch (Exception e) { | |
Crashlytics.logException(e); | |
} | |
} | |
@Override | |
public void showMessage(int errorMessage) { | |
showMessage(getString(errorMessage)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment