• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AlertDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.holoeverywhere.app.AlertDialog的典型用法代码示例。如果您正苦于以下问题:Java AlertDialog类的具体用法?Java AlertDialog怎么用?Java AlertDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AlertDialog类属于org.holoeverywhere.app包,在下文中一共展示了AlertDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
protected Dialog onCreateDialog(Context context) {
    context = getDialogContext(true);
    mBuilder = new AlertDialog.Builder(context,
            ((ContextThemeWrapperPlus) context).getThemeResource());
    mBuilder.setTitle(mDialogTitle);
    mBuilder.setIcon(mDialogIcon);
    mBuilder.setPositiveButton(mPositiveButtonText, this);
    mBuilder.setNegativeButton(mNegativeButtonText, this);
    View contentView = onCreateDialogView(context);
    if (contentView != null) {
        onBindDialogView(contentView);
        mBuilder.setView(contentView);
    } else {
        mBuilder.setMessage(mDialogMessage);
    }
    onPrepareDialogBuilder(mBuilder);
    return mBuilder.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:19,代码来源:DialogPreference.java


示例2: AlertController

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public AlertController(Context context, DialogInterface di, Window window,
                       AlertDecorViewInstaller decorViewInstaller) {
    mDecorViewInstaller = decorViewInstaller;
    mContext = context;
    mDialogInterface = di;
    mWindow = window;
    mHandler = new ButtonHandler(di);
    TypedArray a = context.obtainStyledAttributes(null,
            R.styleable.AlertDialog, R.attr.alertDialogStyle,
            R.style.Holo_AlertDialog);
    mAlertDialogLayout = a.getResourceId(R.styleable.AlertDialog_layout,
            R.layout.alert_dialog_holo);
    mListLayout = a.getResourceId(R.styleable.AlertDialog_listLayout,
            R.layout.select_dialog_holo);
    mMultiChoiceItemLayout = a.getResourceId(
            R.styleable.AlertDialog_multiChoiceItemLayout,
            R.layout.select_dialog_multichoice_holo);
    mSingleChoiceItemLayout = a.getResourceId(
            R.styleable.AlertDialog_singleChoiceItemLayout,
            R.layout.select_dialog_singlechoice_holo);
    mListItemLayout = a.getResourceId(
            R.styleable.AlertDialog_listItemLayout,
            R.layout.select_dialog_item_holo);
    a.recycle();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:26,代码来源:AlertController.java


示例3: onStart

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public void onStart() {
	super.onStart();

	if (getDialog() != null) {
		getDialog().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
	}

	soundManager.setPlaylist(SoundManager.LIST_MAIN);
	Common.fillSlots(getActivity(), slotStrings, slotFileNames, false);
	slotsAdapter.notifyDataSetChanged();

	currentIndex = (
		(getDialog() == null || !(getDialog() instanceof AlertDialog) || ((AlertDialog)getDialog()).getListView() == null) ?
		0 :
		((AlertDialog)getDialog()).getListView().getCheckedItemPosition()
	);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:19,代码来源:SaveDialogFragment.java


示例4: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	return new AlertDialog.Builder(activity)
		.setIcon(R.drawable.ic_dialog_alert)
		.setTitle(R.string.dlg_new_game)
		.setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int whichButton) {
				activity.tracker.sendEventAndFlush(Common.GA_CATEGORY, "RestartPressed", "", 0);
				activity.engine.deleteInstantSave();
				activity.showFragment(activity.selectEpisodeFragment);
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:17,代码来源:RestartWarnDialogFragment.java


示例5: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	saveName = getArguments().getString(SAVE_NAME);

	return new AlertDialog.Builder(activity)
		.setIcon(R.drawable.ic_dialog_alert)
		.setTitle(R.string.dlg_new_game)
		.setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int whichButton) {
				if (saveName != null && activity.tryAndLoadInstantState()) {
					activity.tracker.sendEventAndFlush(Common.GA_CATEGORY, "Loaded", activity.engine.state.levelName, 0);
				}

				activity.startGame(saveName == null ? "" : saveName);
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:LoadWarnDialogFragment.java


示例6: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	return new AlertDialog.Builder(activity)
		.setIcon(R.drawable.ic_dialog_alert)
		.setTitle(R.string.dlg_delete_profile)
		.setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int whichButton) {
				MyApplication.self.profile.clear();
				MyApplication.self.profile.save();

				activity.showFragment(activity.storeFragment);
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:18,代码来源:DeleteProfileDialogFragment.java


示例7: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	final ViewGroup viewGroup = (ViewGroup)LayoutInflater.from(activity).inflate(R.layout.dialog_game_code, null);

	return new AlertDialog.Builder(activity)
		.setIcon(R.drawable.ic_dialog_alert)
		.setTitle(R.string.dlg_enter_code)
		.setView(viewGroup)
		.setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int whichButton) {
				EditText editText = (EditText)viewGroup.findViewById(R.id.code);
				engine.game.unprocessedGameCode = editText.getText().toString();
				activity.tracker.sendEventAndFlush(Common.GA_CATEGORY, "CodeEntered", engine.game.unprocessedGameCode, 0);
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:20,代码来源:GameCodeDialogFragment.java


示例8: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	final int storeCategory = getArguments().getInt(KEY_STORE_CATEGORY);
	final int position = getArguments().getInt(KEY_POSITION);
	final Product item = Store.CATEGORIES[storeCategory][position];

	return new AlertDialog.Builder(activity)
		.setTitle(R.string.store_nocred_title)
		.setMessage(Html.fromHtml(String.format(
			getString(R.string.store_nocred_content),
			getString(item.titleResourceId),
			getString(item.descriptionResourceId),
			item.getPrice(profile),
			profile.credits
		)))
		.setPositiveButton(Html.fromHtml(getString(R.string.store_nocred_earn)), new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int whichButton) {
				activity.storeFragment.changeCategory(Store.CATEGORY_EARN);
			}
		})
		.setNegativeButton(Html.fromHtml(getString(R.string.store_nocred_cancel)), null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:25,代码来源:StoreNoCreditsDialogFragment.java


示例9: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	return new AlertDialog.Builder(activity)
		.setTitle(R.string.dlg_select_slot_load)
		.setAdapter(slotsAdapter, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int which) {
				if (which >= 0 && which < slotFileNames.size()) {
					String saveName = slotFileNames.get(which);
					boolean instantStateLoaded = activity.tryAndLoadInstantState();

					if (instantStateLoaded && !activity.engine.state.savedOrNew) {
						LoadWarnDialogFragment.newInstance(saveName).show(getFragmentManager());
					} else {
						if (instantStateLoaded) {
							activity.tracker.sendEventAndFlush(Common.GA_CATEGORY, "Loaded", activity.engine.state.levelName, 0);
						}

						activity.startGame(saveName);
					}
				}
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:27,代码来源:LoadDialogFragment.java


示例10: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	return new AlertDialog.Builder(activity)
		.setTitle(R.string.dlg_share)
		.setAdapter(adapter, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int which) {
				if (which >= 0 && which < items.size()) {
					activity.tracker.sendEventAndFlush(Common.GA_CATEGORY, "Share", items.get(which).title, 0);
					Common.openExternalIntent(getActivity(), items.get(which).intent);
				}
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:17,代码来源:ShareDialogFragment.java


示例11: onPrepareDialogBuilder

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
	builder.setOnKeyListener(new DialogInterface.OnKeyListener() {
		public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
			if (Common.canUseKey(keyCode)) {
				mValue = keyCode;
				updateSummary();

				if (shouldPersist()) {
					persistInt(mValue);
				}

				getDialog().dismiss();
				return true;
			}

			return false;
		}
	});
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:KeyMapPreference.java


示例12: alerter

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public void alerter(String titre, String message) {

		AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
				SuiviActivity.this);

		// set title
		alertDialogBuilder.setTitle(titre);
		alertDialogBuilder.setIcon(R.drawable.ic_action_error);

		// set dialog message
		alertDialogBuilder.setMessage(message).setCancelable(true);

		// create alert dialog
		AlertDialog alertDialog = alertDialogBuilder.create();

		// show it
		alertDialog.show();
	}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:SuiviActivity.java


示例13: alerter

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public void alerter(String titre, String message) {

		AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
				MapActivity.this);

		// set title
		alertDialogBuilder.setTitle(titre);
		alertDialogBuilder.setIcon(R.drawable.ic_action_error);

		// set dialog message
		alertDialogBuilder.setMessage(message).setCancelable(true);

		// create alert dialog
		AlertDialog alertDialog = alertDialogBuilder.create();

		// show it
		alertDialog.show();
	}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:MapActivity.java


示例14: alerter

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public void alerter(String titre, String message) {

		AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
				BureauActivity.this);

		// set title
		alertDialogBuilder.setTitle(titre);
		alertDialogBuilder.setIcon(R.drawable.ic_action_error);

		// set dialog message
		alertDialogBuilder.setMessage(message).setCancelable(true);

		// create alert dialog
		AlertDialog alertDialog = alertDialogBuilder.create();

		// show it
		alertDialog.show();
	}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:BureauActivity.java


示例15: alerter

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public void alerter(String titre, String message) {

		AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
				PaiementActivity.this);

		// set title
		alertDialogBuilder.setTitle(titre);
		alertDialogBuilder.setIcon(R.drawable.ic_action_error);

		// set dialog message
		alertDialogBuilder.setMessage(message).setCancelable(true);

		// create alert dialog
		AlertDialog alertDialog = alertDialogBuilder.create();

		// show it
		alertDialog.show();
	}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:PaiementActivity.java


示例16: alerter

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public void alerter(String titre, String message) {

		AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
				ChangeActivity.this);

		// set title
		alertDialogBuilder.setTitle(titre);
		alertDialogBuilder.setIcon(R.drawable.ic_action_error);

		// set dialog message
		alertDialogBuilder.setMessage(message).setCancelable(true);

		// create alert dialog
		AlertDialog alertDialog = alertDialogBuilder.create();

		// show it
		alertDialog.show();
	}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:ChangeActivity.java


示例17: AlertController

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public AlertController(Context context, DialogInterface di, Window window,
        AlertDecorViewInstaller decorViewInstaller) {
    mDecorViewInstaller = decorViewInstaller;
    mContext = context;
    mDialogInterface = di;
    mWindow = window;
    mHandler = new ButtonHandler(di);
    TypedArray a = context.obtainStyledAttributes(null,
            R.styleable.AlertDialog, R.attr.alertDialogStyle,
            R.style.Holo_AlertDialog);
    mAlertDialogLayout = a.getResourceId(R.styleable.AlertDialog_layout,
            R.layout.alert_dialog_holo);
    mListLayout = a.getResourceId(R.styleable.AlertDialog_listLayout,
            R.layout.select_dialog_holo);
    mMultiChoiceItemLayout = a.getResourceId(
            R.styleable.AlertDialog_multiChoiceItemLayout,
            R.layout.select_dialog_multichoice_holo);
    mSingleChoiceItemLayout = a.getResourceId(
            R.styleable.AlertDialog_singleChoiceItemLayout,
            R.layout.select_dialog_singlechoice_holo);
    mListItemLayout = a.getResourceId(
            R.styleable.AlertDialog_listItemLayout,
            R.layout.select_dialog_item_holo);
    a.recycle();
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:26,代码来源:AlertController.java


示例18: create

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
public static Builder create (Context context, String title, String text) {
	TextView message = new TextView(context);
	message.setTextAppearance(context, android.R.style.TextAppearance_Medium);

	float scale = context.getResources().getDisplayMetrics().density;
	int dpAsPixels = (int) (8*scale + 0.5f);
	message.setPadding(dpAsPixels, dpAsPixels, dpAsPixels, dpAsPixels);
	Spanned s = Html.fromHtml(text);
	if(Build.VERSION.SDK_INT != 16) { //Bug in 4.1 that causes Dialog to crash
		message.setText(s);
		message.setMovementMethod(LinkMovementMethod.getInstance());
	} else {
		message.setText(s.toString());
	}
	
	ScrollView scroll = new ScrollView(context);
	scroll.addView(message);

	return new AlertDialog.Builder(context)
	.setTitle(title)
	.setCancelable(true)
	.setView(scroll);
}
 
开发者ID:johan12345,项目名称:ls-vertretungsplan,代码行数:24,代码来源:LinkAlertDialog.java


示例19: onStart

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
@Override
public void onStart() {
	super.onStart(); // super.onStart() is where dialog.show() is actually
						// called on the underlying dialog, so we have to do
						// it after this point
	AlertDialog d = (AlertDialog) getDialog();
	if (d != null) {
		Button positiveButton = (Button) d
				.getButton(Dialog.BUTTON_POSITIVE);
		positiveButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				String login = ((EditText) view.findViewById(R.id.username))
						.getText().toString();
				String password = ((EditText) view
						.findViewById(R.id.password)).getText().toString();
				mListener.onLogin(login, password);
			}
		});
	}
}
 
开发者ID:johan12345,项目名称:ls-vertretungsplan,代码行数:22,代码来源:LoginDialogFragment.java


示例20: onCreateDialog

import org.holoeverywhere.app.AlertDialog; //导入依赖的package包/类
protected Dialog onCreateDialog(Context context) {
    mBuilder = new AlertDialog.Builder(context);
    mBuilder.setTitle(mDialogTitle);
    mBuilder.setIcon(mDialogIcon);
    mBuilder.setPositiveButton(mPositiveButtonText, this);
    mBuilder.setNegativeButton(mNegativeButtonText, this);
    View contentView = onCreateDialogView(context);
    if (contentView != null) {
        onBindDialogView(contentView);
        mBuilder.setView(contentView);
    } else {
        mBuilder.setMessage(mDialogMessage);
    }
    onPrepareDialogBuilder(mBuilder);
    return mBuilder.create();
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:17,代码来源:DialogPreference.java



注:本文中的org.holoeverywhere.app.AlertDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimpleMGraph类代码示例发布时间:2022-05-22
下一篇:
Java SocksInitRequestDecoder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap