當前位置: 首頁>>代碼示例>>Java>>正文


Java AlertDialog.setOnDismissListener方法代碼示例

本文整理匯總了Java中android.app.AlertDialog.setOnDismissListener方法的典型用法代碼示例。如果您正苦於以下問題:Java AlertDialog.setOnDismissListener方法的具體用法?Java AlertDialog.setOnDismissListener怎麽用?Java AlertDialog.setOnDismissListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.AlertDialog的用法示例。


在下文中一共展示了AlertDialog.setOnDismissListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDialog

import android.app.AlertDialog; //導入方法依賴的package包/類
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;
}
 
開發者ID:quaap,項目名稱:LaunchTime,代碼行數:21,代碼來源:CustomizeLaunchersActivity.java

示例2: showWebAlert

import android.app.AlertDialog; //導入方法依賴的package包/類
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;
}
 
開發者ID:linsir6,項目名稱:TripBuyer,代碼行數:22,代碼來源:MMAlert.java

示例3: create

import android.app.AlertDialog; //導入方法依賴的package包/類
@Override
public AlertDialog create() {
    final AlertDialog dialog = super.create();
    if (!BuildUtils.isAtLeast(Build.VERSION_CODES.JELLY_BEAN_MR1)) {
        dialog.setOnDismissListener(onDismissListener);
    }
    return dialog;
}
 
開發者ID:noties,項目名稱:Requirements,代碼行數:9,代碼來源:AlertDialogBuilder.java

示例4: show

import android.app.AlertDialog; //導入方法依賴的package包/類
@Override
public AlertDialog show() {
    try {
        AlertDialog dialog = create();
        dialog.setOnDismissListener(mOnDismissListener);
        dialog.show();
        return dialog;
    } catch (WindowManager.BadTokenException ignored) {
        return create();
    }
}
 
開發者ID:morogoku,項目名稱:MTweaks-KernelAdiutorMOD,代碼行數:12,代碼來源:Dialog.java

示例5: showInfo

import android.app.AlertDialog; //導入方法依賴的package包/類
/**
 * 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();
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:20,代碼來源:Dlg.java


注:本文中的android.app.AlertDialog.setOnDismissListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。