当前位置: 首页>>代码示例>>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;未经允许,请勿转载。