本文整理匯總了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();
}