Last active
December 26, 2017 18:02
-
-
Save dario61081/e421828503aac1e4e43f4fa78c7cbcb0 to your computer and use it in GitHub Desktop.
Utilidad para mostrar la captura de excepciones del sistema
This file contains hidden or 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
/** | |
* Utilidad para mostrar la captura de exceptions del sistema | |
* @param context | |
* @param message | |
*/ | |
public static void ShowException(@NonNull Context context, @NonNull String message) { | |
Drawable icon = context.getResources().getDrawable(android.R.drawable.ic_dialog_alert); | |
icon.setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY); | |
AlertDialog.Builder dlg = new AlertDialog.Builder(context); | |
dlg.setIcon(icon); | |
dlg.setTitle("Captura error"); | |
dlg.setMessage(message); | |
dlg.setPositiveButton("Aceptar", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
dialog.dismiss(); | |
} | |
}); | |
dlg.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment