List of utility methods to do AlertDialog Create
void | showAlertText(String alertText, Context context) show Alert Text Toast.makeText(context, alertText, Toast.LENGTH_LONG).show(); |
void | showInfoDialog(Context context, String message, String titleStr, String positiveStr, DialogInterface.OnClickListener onClickListener) show Info Dialog AlertDialog.Builder localBuilder = new AlertDialog.Builder(context); localBuilder.setTitle(titleStr); localBuilder.setMessage(message); if (onClickListener == null) onClickListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { }; localBuilder.setPositiveButton(positiveStr, onClickListener); localBuilder.show(); |
void | alert(Context act, String msg) alert AlertDialog.Builder builder = new AlertDialog.Builder(act);
builder.setMessage(msg);
alert = builder.create();
alert.show();
|
void | alert(Context act, int strId) alert String msg = act.getResources().getString(strId); alert(act, msg); |
void | showErrorDialog(Context context, int title, int message) show Error Dialog new AlertDialog.Builder(context).setTitle(context.getString(title))
.setMessage(context.getString(message))
.setPositiveButton(android.R.string.ok, null).create()
.show();
|
void | showAlertDialog(Activity ctx, String title, String text) show Alert Dialog AlertDialog.Builder alertBuilder = new AlertDialog.Builder(ctx);
alertBuilder.setTitle(title);
alertBuilder.setMessage(text);
AlertDialog alert = alertBuilder.create();
alert.show();
|
AlertDialog.Builder | createAlertDialog(Context cx, String title, String message) create Alert Dialog return new AlertDialog.Builder(cx) .setTitle(title) .setMessage(message) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { }) .setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { }); |
void | alert(String title, String message, Context context) alert alert(title, message, context, false); |
void | alert(String title, String message, Context context, boolean linksClickable) alert SpannableString spannableString = new SpannableString(message); if (linksClickable) { Linkify.addLinks(spannableString, Linkify.ALL); AlertDialog dialog = new AlertDialog.Builder(context) .setTitle(title).setMessage(spannableString) .setPositiveButton(android.R.string.ok, null).create(); dialog.show(); ... |
Dialog | confirm(String title, String message, Context context, DialogInterface.OnClickListener onConfirmListener) confirm return confirmBuilder(title, context, onConfirmListener)
.setMessage(message).show();
|