List of utility methods to do AlertDialog Create
Dialog | confirm(String title, View view, Context context, DialogInterface.OnClickListener onConfirmListener) confirm Builder dialogBuilder = confirmBuilder(title, context, onConfirmListener).setView(view); if (view instanceof TextView) { ScrollView scrollView = new ScrollView(context); scrollView.addView(view); dialogBuilder.setView(scrollView); AlertDialog dialog = dialogBuilder.create(); ... |
Builder | confirmBuilder(String title, Context context, DialogInterface.OnClickListener onConfirmListener) confirm Builder Builder builder = new AlertDialog.Builder(context).setTitle(title) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(android.R.string.ok, onConfirmListener); return builder; |
boolean | canShowAlertDialog(Context context) can Show Alert Dialog return context instanceof Activity; |
void | buildAlertMessageNoGps(final Context context) build Alert Message No Gps final AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage( "Your GPS seems to be disabled, do you want to enable it?") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick( final DialogInterface dialog, ... |
void | alert(Context ctx, String msg) alert Toast.makeText(ctx, msg, Toast.LENGTH_LONG).show(); |
void | showAlert(Context context, String title, String message) show Alert AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( context); alertDialogBuilder .setTitle(title) .setMessage(message) .setCancelable(false) .setNeutralButton("OK", new DialogInterface.OnClickListener() { ... |
void | showAlertDialog(Context context, String title, String message) show Alert Dialog AlertDialog dialog = new AlertDialog.Builder(context).create(); dialog.setCancelable(true); dialog.setMessage(message); dialog.setTitle(title); dialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ... |
Runnable | manageAlertDialog( final Activity fourerrActivity, final String dialogTitle, final String dialogMessage) manage Alert Dialog return new Runnable() { public void run() { final AlertDialog alertDialog = buildAlertDialog( dialogTitle, dialogMessage); alertDialog.show(); private AlertDialog buildAlertDialog(final String dialogTitle, final String dialogMessage) { ... |
void | showAlertDialog(Context context, String title, String message, String btnString, DialogInterface.OnClickListener onClickListener) show Alert Dialog AlertDialog alertDialog = new AlertDialog.Builder(context).create();
alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
alertDialog.setTitle(title);
alertDialog.setMessage(message);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, btnString,
onClickListener);
alertDialog.show();
|
AlertDialog | newYesNoDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId, OnClickListener listener) Creates a new Yes/No AlertDialog AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(false); builder.setPositiveButton(android.R.string.yes, listener); builder.setNegativeButton(android.R.string.no, listener); builder.setTitle(dialogTitle); builder.setMessage(screenMessage); builder.setIcon(iconResourceId); return builder.create(); ... |