use of android.content.DialogInterface.OnClickListener in project openkit-android by OpenKit.
the class OKLoginFragment method showLoginErrorMessage.
private void showLoginErrorMessage(String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(OKLoginFragment.this.getActivity());
builder.setTitle("Error");
builder.setMessage(message);
builder.setNegativeButton("OK", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialogDelegate.onLoginFailed();
}
});
builder.setCancelable(false);
// create alert dialog
AlertDialog alertDialog = builder.create();
// show it
alertDialog.show();
}
use of android.content.DialogInterface.OnClickListener in project openkit-android by OpenKit.
the class FacebookUtilities method showErrorMessage.
public static void showErrorMessage(String message, Context context) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("Error");
builder.setMessage(message);
builder.setNegativeButton("OK", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
// create alert dialog
AlertDialog alertDialog = builder.create();
// show it
alertDialog.show();
}
use of android.content.DialogInterface.OnClickListener in project Signal-Android by WhisperSystems.
the class WebRtcCallActivity method handleNoSuchUser.
private void handleNoSuchUser(@NonNull final WebRtcViewModel event) {
// XXX Stuart added this check above, not sure why, so I'm repeating in ignorance. - moxie
if (isFinishing())
return;
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle(R.string.RedPhone_number_not_registered);
dialog.setIconAttribute(R.attr.dialog_alert_icon);
dialog.setMessage(R.string.RedPhone_the_number_you_dialed_does_not_support_secure_voice);
dialog.setCancelable(true);
dialog.setPositiveButton(R.string.RedPhone_got_it, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
WebRtcCallActivity.this.handleTerminate(event.getRecipient());
}
});
dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
WebRtcCallActivity.this.handleTerminate(event.getRecipient());
}
});
dialog.show();
}
use of android.content.DialogInterface.OnClickListener in project KJFrameForAndroid by kymjs.
the class ViewInject method getExitDialog.
/**
* 返回一个退出确认对话框
*/
public void getExitDialog(final Context context, String title, OnClickListener l) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(title);
builder.setCancelable(false);
builder.setNegativeButton("取消", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.setPositiveButton("确定", l);
builder.create();
builder.show();
builder = null;
}
use of android.content.DialogInterface.OnClickListener in project k-9 by k9mail.
the class CryptoSettingsDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Bundle arguments = savedInstanceState != null ? savedInstanceState : getArguments();
currentMode = CryptoMode.valueOf(arguments.getString(ARG_CURRENT_MODE));
@SuppressLint("InflateParams") View view = LayoutInflater.from(getActivity()).inflate(R.layout.crypto_settings_dialog, null);
cryptoModeSelector = (CryptoModeSelector) view.findViewById(R.id.crypto_status_selector);
cryptoStatusText = (LinearViewAnimator) view.findViewById(R.id.crypto_status_text);
cryptoModeSelector.setCryptoStatusListener(this);
updateView(false);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setView(view);
builder.setNegativeButton(R.string.crypto_settings_cancel, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
dialog.dismiss();
}
});
builder.setPositiveButton(R.string.crypto_settings_ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
changeCryptoSettings();
dialog.dismiss();
}
});
return builder.create();
}
Aggregations