Android Utililty Methods AlertDialog Create

List of utility methods to do AlertDialog Create

Description

The list of methods to do AlertDialog Create are organized into topic(s).

Method

Dialogconfirm(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();
...
BuilderconfirmBuilder(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;
booleancanShowAlertDialog(Context context)
can Show Alert Dialog
return context instanceof Activity;
voidbuildAlertMessageNoGps(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,
...
voidalert(Context ctx, String msg)
alert
Toast.makeText(ctx, msg, Toast.LENGTH_LONG).show();
voidshowAlert(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() {
...
voidshowAlertDialog(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) {
...
RunnablemanageAlertDialog( 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) {
...
voidshowAlertDialog(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();
AlertDialognewYesNoDialog(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();
...