Java Code Examples for android.app.AlertDialog.setOnDismissListener()

The following are Jave code examples for showing how to use setOnDismissListener() of the android.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: LaunchTime   File: CustomizeLaunchersActivity.java   Source Code and License Vote up 6 votes
public  Dialog createDialog() {
    mAdapter = new ArrayAdapter<String>(CustomizeLaunchersActivity.this, R.layout.add_list_item);
    mAdapter.add(getString(R.string.custom_icon_select_picture));
    mAdapter.add(getString(R.string.custom_icon_icon_packs));
    if (SpecialIconStore.hasBitmap(CustomizeLaunchersActivity.this, mAppClicked.getComponentName(), SpecialIconStore.IconType.Custom)) {
        mAdapter.add(getString(R.string.custom_icon_clear_icon));
    }

    final AlertDialog.Builder builder = new AlertDialog.Builder(CustomizeLaunchersActivity.this);
    builder.setTitle(R.string.custom_icon_select_icon_type);
    builder.setAdapter(mAdapter, this);

    //builder.setInverseBackgroundForced(false);

    AlertDialog dialog = builder.create();
    dialog.setOnCancelListener(this);
    dialog.setOnDismissListener(this);
    dialog.setOnShowListener(this);
    return dialog;
}
 
Example 2
Project: TripBuyer   File: MMAlert.java   Source Code and License Vote up 6 votes
public static AlertDialog showWebAlert(final Context context, final String title, final String rawUrl, final WebViewClient client, final DialogInterface.OnClickListener lOk,
									   final DialogInterface.OnDismissListener lDismiss) {
	final View view = View.inflate(context, R.layout.webalert, null);
	final AlertDialog alert = showAlert(context, title, view, lOk);
	alert.setOnDismissListener(new DialogInterface.OnDismissListener() {

		@Override
		public void onDismiss(DialogInterface dialog) {

			if (lDismiss != null) {
				lDismiss.onDismiss(dialog);
			}
		}
	});
	final WebView info = (WebView) view.findViewById(R.id.info_wv);
	info.loadUrl(rawUrl);
	if (client != null) {
		info.setWebViewClient(client);
	}
	return alert;
}
 
Example 3
Project: TripBuyer   File: MMAlert.java   Source Code and License Vote up 6 votes
public static AlertDialog showWebAlert(final Context context, final String title, final String rawUrl, final WebViewClient client, final String ok, final String cancel,
									   final DialogInterface.OnClickListener lOk, final DialogInterface.OnClickListener lCancel, final DialogInterface.OnDismissListener lDismiss) {
	final View view = View.inflate(context, R.layout.webalert, null);
	final AlertDialog alert = showAlert(context, title, view, ok, cancel, lOk, lCancel);
	alert.setOnDismissListener(new DialogInterface.OnDismissListener() {

		@Override
		public void onDismiss(DialogInterface dialog) {
			if (lDismiss != null) {
				lDismiss.onDismiss(dialog);
			}
		}
	});

	final WebView info = (WebView) view.findViewById(R.id.info_wv);
	info.loadUrl(rawUrl);
	if (client != null) {
		info.setWebViewClient(client);
	}
	return alert;
}
 
Example 4
Project: Requirements   File: AlertDialogBuilder.java   Source Code and License Vote up 5 votes
@Override
public AlertDialog create() {
    final AlertDialog dialog = super.create();
    if (!BuildUtils.isAtLeast(Build.VERSION_CODES.JELLY_BEAN_MR1)) {
        dialog.setOnDismissListener(onDismissListener);
    }
    return dialog;
}
 
Example 5
Project: MTweaks-KernelAdiutorMOD   File: Dialog.java   Source Code and License Vote up 5 votes
@Override
public AlertDialog show() {
    try {
        AlertDialog dialog = create();
        dialog.setOnDismissListener(mOnDismissListener);
        dialog.show();
        return dialog;
    } catch (WindowManager.BadTokenException ignored) {
        return create();
    }
}
 
Example 6
Project: KernelAdiutor-Mod   File: Dialog.java   Source Code and License Vote up 5 votes
@Override
public AlertDialog show() {
    try {
        AlertDialog dialog = create();
        dialog.setOnDismissListener(mOnDismissListener);
        dialog.show();
        return dialog;
    } catch (WindowManager.BadTokenException ignored) {
        return create();
    }
}
 
Example 7
Project: keepass2android   File: Dlg.java   Source Code and License Vote up 4 votes
/**
 * Shows an info dialog.
 * 
 * @param context
 *            {@link Context}
 * @param msg
 *            the message.
 * @param listener
 *            the {@link DialogInterface.OnDismissListener}.
 */
public static void showInfo(Context context, CharSequence msg,
        DialogInterface.OnDismissListener listener) {
    AlertDialog dlg = newAlertDlg(context);
    dlg.setIcon(android.R.drawable.ic_dialog_info);
    dlg.setTitle(R.string.afc_title_info);
    dlg.setMessage(msg);
    dlg.setOnDismissListener(listener);
    dlg.show();
}