Here are the examples of the java api android.content.DialogInterface taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
571 Examples
19
Source : FinishListener.java
with Apache License 2.0
from yushiwo
with Apache License 2.0
from yushiwo
public void onCancel(DialogInterface dialogInterface) {
run();
}
19
Source : FinishListener.java
with Apache License 2.0
from yushiwo
with Apache License 2.0
from yushiwo
public void onClick(DialogInterface dialogInterface, int i) {
run();
}
19
Source : DialogListener.java
with Apache License 2.0
from xxyangyoulin
with Apache License 2.0
from xxyangyoulin
public void onItemClick(DialogInterface dialog, int which) {
}
19
Source : DialogListener.java
with Apache License 2.0
from xxyangyoulin
with Apache License 2.0
from xxyangyoulin
public void onPositive(DialogInterface dialog, int which) {
}
19
Source : DialogListener.java
with Apache License 2.0
from xxyangyoulin
with Apache License 2.0
from xxyangyoulin
public void onNegative(DialogInterface dialog, int which) {
}
19
Source : FeedBackDialog.java
with Apache License 2.0
from shivasurya
with Apache License 2.0
from shivasurya
private void onCancelListener(DialogInterface dialog) {
if (mReviewActionsListener != null) {
mReviewActionsListener.onCancelListener(dialog);
}
}
19
Source : CommonPrefs.java
with MIT License
from SDRausty
with MIT License
from SDRausty
public void onClick(DialogInterface dialog, int which) {
if (Dialog.BUTTON_NEGATIVE == which) {
// cancel disclaimer
activateScreenFlashlight();
}
}
19
Source : VolumeSettingHandler.java
with MIT License
from SDRausty
with MIT License
from SDRausty
public void onCancel(DialogInterface dialog) {
mDialog.hide();
}
19
Source : VolumeDialog.java
with MIT License
from SDRausty
with MIT License
from SDRausty
public void onCancel(DialogInterface dialog) {
hide();
}
19
Source : UnlockPatternSettingHandler.java
with MIT License
from SDRausty
with MIT License
from SDRausty
public void onClick(DialogInterface dialog, int which) {
if (which == -2) {
// show pattern setup screen
try {
chooseLockPattern();
} catch (Exception e) {
// fallback, show page for this setting
super.onSelected(0);
}
}
// enable in any case
super.onSwitched(true);
}
19
Source : IadtDialogBuilder.java
with Apache License 2.0
from rafaco
with Apache License 2.0
from rafaco
// Native dismiss catcher redirected to DialogManager
public void onDismiss(DialogInterface dialog) {
getManager().onDialogDismissedExternally(dialog);
}
19
Source : ActivityPicker.java
with GNU General Public License v3.0
from PowerExplorer
with GNU General Public License v3.0
from PowerExplorer
/**
* Handle canceled dialog by preplaceding back {@link Activity#RESULT_CANCELED}.
*/
public void onCancel(DialogInterface dialog) {
setResult(Activity.RESULT_CANCELED);
finish();
}
19
Source : LatinIMESettings.java
with GNU General Public License v3.0
from PhilippC
with GNU General Public License v3.0
from PhilippC
public void onDismiss(DialogInterface dialog) {
}
19
Source : SafetyNumberChangeDialog.java
with GNU General Public License v3.0
from mollyim
with GNU General Public License v3.0
from mollyim
private void handleCancel(@NonNull DialogInterface dialogInterface, int which) {
if (getActivity() instanceof Callback) {
((Callback) getActivity()).onCanceled();
}
}
19
Source : PreferenceScreen.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
public void onDismiss(DialogInterface dialog) {
mDialog = null;
getPreferenceManager().removePreferencesScreen(dialog);
}
19
Source : DialogPreference.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
public void onDismiss(DialogInterface dialog) {
getPreferenceManager().unregisterOnActivityDestroyListener(this);
mDialog = null;
onDialogClosed(mWhichButtonClicked == DialogInterface.BUTTON_POSITIVE);
}
19
Source : DialogPreference.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
public void onClick(DialogInterface dialog, int which) {
mWhichButtonClicked = which;
}
19
Source : DialogFragment.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
public void onCancel(DialogInterface dialog) {
}
19
Source : DialogFragment.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
public void onDismiss(DialogInterface dialog) {
if (!mViewDestroyed) {
// Note: we need to use allowStateLoss, because the dialog
// dispatches this asynchronously so we can receive the call
// after the activity is paused. Worst case, when the user comes
// back to the activity they see the dialog again.
dismissInternal(true);
}
}
19
Source : DialogUtils.java
with MIT License
from jianliaoim
with MIT License
from jianliaoim
public static void hideKeyboard(DialogInterface di, final TalkDialog.Builder builder) {
final TalkDialog dialog = (TalkDialog) di;
if (dialog.getInputEditText() == null)
return;
dialog.getInputEditText().post(new Runnable() {
@Override
public void run() {
dialog.getInputEditText().requestFocus();
InputMethodManager imm = (InputMethodManager) builder.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null)
imm.hideSoftInputFromWindow(dialog.getInputEditText().getWindowToken(), 0);
}
});
}
19
Source : DialogUtils.java
with MIT License
from jianliaoim
with MIT License
from jianliaoim
public static void showKeyboard(DialogInterface di, final TalkDialog.Builder builder) {
final TalkDialog dialog = (TalkDialog) di;
if (dialog.getInputEditText() == null)
return;
dialog.getInputEditText().post(new Runnable() {
@Override
public void run() {
dialog.getInputEditText().requestFocus();
InputMethodManager imm = (InputMethodManager) builder.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null)
imm.showSoftInput(dialog.getInputEditText(), InputMethodManager.SHOW_IMPLICIT);
}
});
}
19
Source : HotSquareShareDialog.java
with Apache License 2.0
from JackChan1999
with Apache License 2.0
from JackChan1999
public void onDismiss(DialogInterface dialog) {
this.onShareDialogDismissListener.shareDismiss(true);
}
19
Source : DialogFragment.java
with Apache License 2.0
from JackChan1999
with Apache License 2.0
from JackChan1999
public void onDismiss(DialogInterface dialog) {
if (!this.mViewDestroyed) {
dismissInternal(true);
}
}
19
Source : MeiCompatDialogDelegate.java
with Apache License 2.0
from HpWens
with Apache License 2.0
from HpWens
public void onDismiss(DialogInterface dialog) {
if (mOnDismissListener != null) {
mOnDismissListener.onDismiss(dialog);
}
}
19
Source : ViewClickInjector.java
with Apache License 2.0
from growingio
with Apache License 2.0
from growingio
@BeforeSuper(clazz = DialogInterface.OnClickListener.clreplaced, method = "onClick", parameterTypes = { DialogInterface.clreplaced, int.clreplaced })
public static void dialogOnClick(DialogInterface.OnClickListener listener, DialogInterface dialogInterface, int which) {
if (dialogInterface instanceof AlertDialog) {
ViewClickProvider.alertDialogOnClick((AlertDialog) dialogInterface, which);
}
}
19
Source : SingleSelectDialogFactory.java
with Apache License 2.0
from google
with Apache License 2.0
from google
private void onSelect(DialogInterface dialog, int which) {
if (checkedItem == which) {
// Allow user to toggle values off by tapping selected item.
checkedItem = -1;
((AlertDialog) dialog).getListView().sereplacedemChecked(which, false);
} else {
checkedItem = which;
}
}
19
Source : MyDialogListener.java
with Apache License 2.0
from glassLake
with Apache License 2.0
from glassLake
public void onThird(DialogInterface dialog) {
}
19
Source : Utility.java
with GNU General Public License v3.0
from fekracomputers
with GNU General Public License v3.0
from fekracomputers
public static String getInputText(DialogInterface dialog) {
return ((EditText) ((AlertDialog) dialog).findViewById(R.id.text1)).getText().toString();
}
19
Source : DialogFragment.java
with Apache License 2.0
from covidsafewatch
with Apache License 2.0
from covidsafewatch
public void onCancel(DialogInterface dialogInterface) {
}
19
Source : DialogFragment.java
with Apache License 2.0
from covidsafewatch
with Apache License 2.0
from covidsafewatch
public void onDismiss(DialogInterface dialogInterface) {
if (!this.mViewDestroyed) {
dismissInternal(true, true);
}
}
19
Source : MenuDialogHelper.java
with Apache License 2.0
from covidsafewatch
with Apache License 2.0
from covidsafewatch
public void onDismiss(DialogInterface dialogInterface) {
this.mPresenter.onCloseMenu(this.mMenu, true);
}
19
Source : MenuDialogHelper.java
with Apache License 2.0
from covidsafewatch
with Apache License 2.0
from covidsafewatch
public void onClick(DialogInterface dialogInterface, int i) {
this.mMenu.performItemAction((MenuItemImpl) this.mPresenter.getAdapter().gereplacedem(i), 0);
}
19
Source : MenuDialogHelper.java
with GNU General Public License v2.0
from Cloudslab
with GNU General Public License v2.0
from Cloudslab
public void onDismiss(DialogInterface dialog) {
this.mPresenter.onCloseMenu(this.mMenu, true);
}
19
Source : MenuDialogHelper.java
with GNU General Public License v2.0
from Cloudslab
with GNU General Public License v2.0
from Cloudslab
public void onClick(DialogInterface dialog, int which) {
this.mMenu.performItemAction((MenuItemImpl) this.mPresenter.getAdapter().gereplacedem(which), 0);
}
19
Source : StageEditorDialog.java
with Mozilla Public License 2.0
from ChessCom
with Mozilla Public License 2.0
from ChessCom
public void onClick(DialogInterface dialog, int which) {
if (mCallback != null) {
if (which == BUTTON_POSITIVE) {
int moves = mStageEditorView.getCurrentMoves();
int hour = mStageEditorView.getCurrentHour();
int minute = mStageEditorView.getCurrentMinute();
int second = mStageEditorView.getCurrentSeconds();
long newDuration = (hour * 60 * 60 * 1000) + (second * 1000) + (minute * 60 * 1000);
mCallback.onStageEditDone(moves, newDuration);
}
}
}
19
Source : SubtitleDelayPickerDialog.java
with Apache License 2.0
from archos-sa
with Apache License 2.0
from archos-sa
public void onClick(DialogInterface dialog, int which) {
if (mCallBack != null) {
mCallBack.onDelayChange(mSubreplacedleDelayPicker, mSubreplacedleDelayPicker.getDelay(), mRatio);
}
}
19
Source : AudioDelayPickerDialog.java
with Apache License 2.0
from archos-sa
with Apache License 2.0
from archos-sa
public void onClick(DialogInterface dialog, int which) {
if (mCallBack != null) {
mCallBack.onAudioDelayChange(mAudioDelayPicker, mAudioDelayPicker.getDelay());
}
}
19
Source : DialogUtils.java
with Apache License 2.0
from amit-bhandari
with Apache License 2.0
from amit-bhandari
public static void showKeyboard(@NonNull final DialogInterface di, @NonNull final MaterialDialog.Builder builder) {
final MaterialDialog dialog = (MaterialDialog) di;
if (dialog.getInputEditText() == null) {
return;
}
dialog.getInputEditText().post(new Runnable() {
@Override
public void run() {
dialog.getInputEditText().requestFocus();
InputMethodManager imm = (InputMethodManager) builder.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
imm.showSoftInput(dialog.getInputEditText(), InputMethodManager.SHOW_IMPLICIT);
}
}
});
}
18
Source : SupportBlurDialogFragment.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
mBlurEngine.onDismiss();
}
18
Source : AlertDialogFragment.java
with GNU General Public License v2.0
from ZorinOS
with GNU General Public License v2.0
from ZorinOS
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if (callback != null) {
callback.onDismiss();
}
}
18
Source : AlertDialogFragment.java
with GNU General Public License v2.0
from ZorinOS
with GNU General Public License v2.0
from ZorinOS
@Override
public void onCancel(DialogInterface dialog) {
super.onCancel(dialog);
if (callback != null) {
callback.onCancel();
}
}
18
Source : AlertDialogFragment.java
with GNU General Public License v2.0
from ZorinOS
with GNU General Public License v2.0
from ZorinOS
@Override
public void onClick(DialogInterface dialog, int which) {
if (callback == null) {
return;
}
switch(which) {
case AlertDialog.BUTTON_POSITIVE:
callback.onPositiveButtonClicked();
break;
case AlertDialog.BUTTON_NEGATIVE:
callback.onNegativeButtonClicked();
break;
default:
break;
}
}
18
Source : IntentChooserFragment.java
with Apache License 2.0
from zixpo
with Apache License 2.0
from zixpo
@Override
public void onDismiss(@NotNull DialogInterface dialog) {
if (mAsyncTask != null) {
mAsyncTask.cancel(true);
}
super.onDismiss(dialog);
}
18
Source : CameraDialog.java
with Apache License 2.0
from z-jc
with Apache License 2.0
from z-jc
@Override
public void onCancel(final DialogInterface dialog) {
((CameraDialogParent) getActivity()).onDialogResult(true);
super.onCancel(dialog);
}
18
Source : ThreeActionsAlertDialogFragment.java
with GNU General Public License v3.0
from ywwynm
with GNU General Public License v3.0
from ywwynm
@Override
public void onDismiss(DialogInterface dialog) {
if (!mContinued && mOnClickListener != null) {
mOnClickListener.onThirdClicked();
}
mOnClickListener = null;
super.onDismiss(dialog);
}
18
Source : PatternLockDialogFragment.java
with GNU General Public License v3.0
from ywwynm
with GNU General Public License v3.0
from ywwynm
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if (mType == TYPE_VALIDATE && !mValidated && mAuthenticationCallback != null) {
mAuthenticationCallback.onCancel();
}
mPreplacedwordSetDoneListener = null;
mAuthenticationCallback = null;
}
18
Source : LongTextDialogFragment.java
with GNU General Public License v3.0
from ywwynm
with GNU General Public License v3.0
from ywwynm
@Override
public void onDismiss(DialogInterface dialog) {
if (!mConfirmed && mCancelListener != null) {
mCancelListener.onClick(f(R.id.tv_cancel_as_bt_long_text));
}
mConfirmListener = null;
mCancelListener = null;
super.onDismiss(dialog);
}
18
Source : ChooserDialogFragment.java
with GNU General Public License v3.0
from ywwynm
with GNU General Public License v3.0
from ywwynm
@Override
public void onDismiss(DialogInterface dialog) {
if (mOnDismissListener != null) {
mOnDismissListener.onDismiss();
}
mConfirmListener = null;
mOnDismissListener = null;
mMoreListener = null;
mOnItemClickListener = null;
super.onDismiss(dialog);
}
18
Source : AlertDialogFragment.java
with GNU General Public License v3.0
from ywwynm
with GNU General Public License v3.0
from ywwynm
@Override
public void onDismiss(DialogInterface dialog) {
if (!mConfirmed && mCancelListener != null) {
mCancelListener.onCancel();
}
mConfirmListener = null;
mCancelListener = null;
super.onDismiss(dialog);
}
18
Source : FinishListener.java
with MIT License
from yuzhiqiang1993
with MIT License
from yuzhiqiang1993
@Override
public void onClick(DialogInterface dialogInterface, int i) {
run();
}
See More Examples