本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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();
}