List of utility methods to do AlertDialog Create
AlertDialog | newMessageDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId) Creates a new AlertDialog to display a simple message AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(false); builder.setPositiveButton("Okay", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); }); builder.setTitle(dialogTitle); ... |
void | showAuthenticatedDialog(Context context, String title, String text) show Authenticated Dialog AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(title); builder.setMessage(text); builder.setNeutralButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { }); builder.show(); |
void | showMessageDialog(Context context, String title, String strText) show Message Dialog AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(title); builder.setMessage(strText); builder.setNeutralButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { }); builder.show(); |
void | showSingleDialog(Context context, String title, String msg, boolean cancelable) Function to create AlertDialog AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(msg).setCancelable(cancelable).setTitle(title) .setPositiveButton("OK", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); }); ... |
Dialog | getInstallationDialog(final Context context) get Installation Dialog AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage("SensApp application is needed. Would you like install it now?"); builder.setCancelable(false); builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Uri uri = Uri.parse("market://details?id=" + "org.sensapp.android.sensappdroid"); ... |
void | showDialog(Context context, String title, String message) show Dialog new AlertDialog.Builder(context).setTitle(title)
.setMessage(message)
.setPositiveButton(android.R.string.ok, null)
.setIcon(android.R.drawable.ic_dialog_alert).show();
|
void | makeDialogBox(Context context, String title, String message, String cancleButton, DialogInterface.OnClickListener cancelCallBack, String okayButton, DialogInterface.OnClickListener okayCallBack) make Dialog Box AlertDialog.Builder alertBuilder = new AlertDialog.Builder(context);
alertBuilder.setTitle(title).setMessage(message)
.setCancelable(true)
.setNegativeButton(cancleButton, cancelCallBack)
.setPositiveButton(okayButton, okayCallBack);
AlertDialog alertDialog = alertBuilder.create();
alertDialog.show();
|
void | simpleDialogBox(Context context, String message) simple Dialog Box AlertDialog.Builder alertBuilder = new AlertDialog.Builder(context); alertBuilder.setTitle("Photo Cache").setMessage(message) .setCancelable(true) .setPositiveButton("Okay", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); }); AlertDialog alertDialog = alertBuilder.create(); alertDialog.show(); |
void | dismissProgressBar(ProgressDialog progressBar) dismiss Progress Bar progressBar.dismiss(); |
void | showConnectionErrorDialog(Context c) show Connection Error Dialog AlertDialog.Builder builder = new AlertDialog.Builder(c); builder.setTitle("Uh oh") .setMessage( "We were unable to reach openwatch.net. Please check your network connection and try again.") .setPositiveButton("Bummer", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, ... |