Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Create a generic alertDialog with title and text. No buttons here, we do this elsewhere
- *
- * @param dialogTitle -> What we want the title of the dialog to be.
- * @param dialogMessage -> What we want the message of the dialog to be.
- * @param context -> context
- */
- public AlertDialog createGenericDialog(String dialogTitle, String dialogMessage, Context context) {
- AlertDialog alertDialog = new AlertDialog.Builder(context).create();
- alertDialog.setTitle(dialogTitle);
- alertDialog.setMessage(dialogMessage);
- alertDialog.setCanceledOnTouchOutside(false);
- return alertDialog;
- }
- /**
- * Create an dialog informing the user of an error when an exception has been thrown.
- *
- * @param context -> context
- * @param errorType -> The type of name of the exception that is been thrown.
- * @param locale -> Where the exception has been thrown.
- * @param errorMessage -> A more understandable message describing the error
- */
- public void createErrorDialog(String errorType, String locale, String errorMessage, Context context){
- AlertDialog alertDialog = createGenericDialog(errorType, locale + "\n" + errorMessage, context);
- alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, context.getString(R.string.ok), dismissButtonListener());
- alertDialog.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement