Example usage for android.content DialogInterface BUTTON_NEUTRAL

List of usage examples for android.content DialogInterface BUTTON_NEUTRAL

Introduction

In this page you can find the example usage for android.content DialogInterface BUTTON_NEUTRAL.

Prototype

int BUTTON_NEUTRAL

To view the source code for android.content DialogInterface BUTTON_NEUTRAL.

Click Source Link

Document

The identifier for the neutral button.

Usage

From source file:Main.java

public static void showAlertDialog(Context ctx, String title, String message) {

    AlertDialog alertDialog = new AlertDialog.Builder(ctx).create();
    alertDialog.setTitle(title);//from  w ww .  ja v a 2  s .  c  o  m
    alertDialog.setMessage(message);

    alertDialog.setButton(DialogInterface.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {

        }
    });
    alertDialog.show();
}

From source file:com.crea_si.eviacam.wizard.WizardUtils.java

static void checkEngineAndFinishIfNeeded(final Activity a) {
    AccessibilityServiceModeEngine engine = MainEngine.getAccessibilityServiceModeEngine();
    if (engine == null || !engine.isReady()) {
        // Engine is not ready anymore
        final Resources res = a.getResources();
        AlertDialog ad = new AlertDialog.Builder(a).create();
        ad.setCancelable(false); // This blocks the 'BACK' button
        ad.setTitle(res.getText(R.string.eva_not_running));
        ad.setMessage(res.getText(R.string.eva_not_running_summary));
        ad.setButton(DialogInterface.BUTTON_NEUTRAL, res.getText(R.string.close),
                new DialogInterface.OnClickListener() {
                    @Override/*from  w  w w  .  j  av  a 2 s  .c  om*/
                    public void onClick(DialogInterface dialog, int which) {
                        finishWizard(a);
                    }
                });
        ad.show();
    }
}

From source file:com.aniruddhc.acemusic.player.AsyncTasks.AsyncDeleteTask.java

protected void onPreExecute() {
    pd = new ProgressDialog(mContext);
    pd.setCancelable(false);/*from  w w  w  .jav  a2s  . c o m*/
    pd.setIndeterminate(false);
    pd.setTitle(R.string.delete);
    pd.setMessage(mContext.getResources().getString(R.string.deleting_files));
    pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources().getString(R.string.run_in_background),
            new OnClickListener() {

                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    pd.dismiss();

                }

            });

    pd.show();

}

From source file:ie.programmer.catcher.browser.AsyncTasks.AsyncDeleteTask.java

protected void onPreExecute() {
    if (mSourceFile == null)
        return;/*from  ww w.jav  a  2 s. co m*/
    //Skip the rest of this method if the user doesn't want a progress dialog.
    if (!mShowProgress)
        return;
    pd = new ProgressDialog(mContext);
    pd.setCancelable(false);
    pd.setIndeterminate(false);
    pd.setTitle(R.string.delete);
    pd.setMessage(mContext.getResources().getString(R.string.deleting) + " " + mSourceFile.getName());
    pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources().getString(R.string.run_in_background),
            new OnClickListener() {
                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    pd.dismiss();
                }
            });
    pd.show();
    if (mDeleteInterface != null)
        mDeleteInterface.preDeleteStartSync();
}

From source file:de.vanita5.twittnuker.fragment.support.ColorPickerDialogFragment.java

@Override
public void onClick(final DialogInterface dialog, final int which) {
    final FragmentActivity a = getActivity();
    final Dialog d = getDialog();
    if (!(a instanceof Callback) || !(d instanceof ColorPickerDialog))
        return;/*from  w  w w .j  ava 2  s.c  om*/
    switch (which) {
    case DialogInterface.BUTTON_POSITIVE: {
        final int color = ((ColorPickerDialog) d).getColor();
        ((Callback) a).onColorSelected(color);
        break;
    }
    case DialogInterface.BUTTON_NEUTRAL: {
        ((Callback) a).onColorCleared();
        break;
    }
    }
}

From source file:com.psaravan.filebrowserview.lib.AsyncTasks.AsyncDeleteTask.java

protected void onPreExecute() {

    if (mSourceFile == null)
        return;/*from ww  w. j  a  v  a2  s  .c  om*/

    //Skip the rest of this method if the user doesn't want a progress dialog.
    if (!mShowProgress)
        return;

    pd = new ProgressDialog(mContext);
    pd.setCancelable(false);
    pd.setIndeterminate(false);
    pd.setTitle(R.string.delete);
    pd.setMessage(mContext.getResources().getString(R.string.deleting) + " " + mSourceFile.getName());
    pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources().getString(R.string.run_in_background),
            new OnClickListener() {

                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    pd.dismiss();

                }

            });

    pd.show();

    if (mDeleteInterface != null)
        mDeleteInterface.preDeleteStartSync();

}

From source file:org.mariotaku.twidere.fragment.ColorPickerDialogFragment.java

@Override
public void onClick(final DialogInterface dialog, final int which) {
    final FragmentActivity a = getActivity();
    if (!(a instanceof Callback) || mController == null)
        return;/*  w w w  .  jav a2 s  . c o  m*/
    switch (which) {
    case DialogInterface.BUTTON_POSITIVE: {
        final int color = mController.getColor();
        ((Callback) a).onColorSelected(color);
        break;
    }
    case DialogInterface.BUTTON_NEUTRAL: {
        ((Callback) a).onColorCleared();
        break;
    }
    }
}

From source file:org.libreoffice.impressremote.fragment.TimerEditingDialog.java

@Override
public Dialog onCreateDialog(Bundle aSavedInstanceState) {
    TimePickerDialog aDialog = new TimePickerDialog(getActivity(), this, getHours(mMinutes),
            getMinutes(mMinutes), IS_24_HOUR_VIEW);

    aDialog.setTitle(R.string.title_timer);

    aDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.button_save), this);
    aDialog.setButton(DialogInterface.BUTTON_NEUTRAL, getString(R.string.button_remove), this);

    return aDialog;
}

From source file:ie.programmer.catcher.browser.AsyncTasks.AsyncMoveTask.java

@Override
protected void onPreExecute() {
    if (mSourceFile == null)
        return;//from   w w  w  .  j  ava2  s . c o  m
    //Skip the rest of this method if the user doesn't want a progress dialog.
    if (!mShowProgress)
        return;
    pd = new ProgressDialog(mContext);
    pd.setCancelable(false);
    pd.setIndeterminate(false);
    pd.setTitle(R.string.move);
    pd.setMessage(mContext.getResources().getString(R.string.moving) + " " + mSourceFile.getName());
    pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources().getString(R.string.run_in_background),
            new OnClickListener() {
                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    pd.dismiss();
                }
            });
    pd.show();
    if (mMoveInterface != null)
        mMoveInterface.preMoveStartSync();
}

From source file:com.aniruddhc.acemusic.player.AsyncTasks.AsyncCopyMoveTask.java

protected void onPreExecute() {
    pd = new ProgressDialog(mFragment.getActivity());
    pd.setCancelable(false);//from ww w .j  a v a 2  s .  c om
    pd.setIndeterminate(false);

    if (mShouldMove) {
        pd.setTitle(R.string.move);
        pd.setMessage(mContext.getResources().getString(R.string.moving_file));
    } else {
        pd.setTitle(R.string.copy);
        pd.setMessage(mContext.getResources().getString(R.string.copying_file));
    }

    pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources().getString(R.string.run_in_background),
            new OnClickListener() {

                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    pd.dismiss();

                }

            });

    pd.show();

}