Java Code Examples for android.support.v7.app.AlertDialog.BUTTON_NEGATIVE

The following are Jave code examples for showing how to use BUTTON_NEGATIVE of the android.support.v7.app.AlertDialog class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: IelloAndroidAdminApp   File: DialogAPIKey.java   Source Code and License Vote up 6 votes
@Override
public void onClick(DialogInterface dialogInterface, int which) {
    switch (which)
    {
        case AlertDialog.BUTTON_POSITIVE:
            break;

        case AlertDialog.BUTTON_NEGATIVE:
            // se era gia presente una key, allora chiudo semplicmente il dialog,
            // altrimenti significa che non รจ mai stata inserita alcuna chiave, quindi chiudo l'app
            if(!SharedPrefsHelper.getInstance().isApiKeyRegistered(getActivity()))
                getActivity().finish();
            else
                dismiss();
            break;
    }
}
 
Example 2
Project: chromium-for-android-56-debug-video   File: PassphraseDialogFragment.java   Source Code and License Vote up 4 votes
@Override
public void onClick(DialogInterface dialog, int which) {
    if (which == AlertDialog.BUTTON_NEGATIVE) {
        handleCancel();
    }
}