当前位置: 首页>>代码示例>>Java>>正文


Java Builder.create方法代码示例

本文整理汇总了Java中android.app.AlertDialog.Builder.create方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.create方法的具体用法?Java Builder.create怎么用?Java Builder.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.AlertDialog.Builder的用法示例。


在下文中一共展示了Builder.create方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDialog

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static Dialog createDialog(Context context, Bundle arguments, OnClickListener onClickListener) {
    Builder builder = new Builder(context);
    builder.setTitle(arguments.getString(ErrorDialogManager.KEY_TITLE));
    builder.setMessage(arguments.getString(ErrorDialogManager.KEY_MESSAGE));
    if (ERROR_DIALOG_ICON != 0) {
        builder.setIcon(ERROR_DIALOG_ICON);
    }
    builder.setPositiveButton(17039370, onClickListener);
    return builder.create();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:ErrorDialogFragments.java

示例2: onCreateDialog

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
protected Dialog onCreateDialog(int id) {
	
	if (id == 0) {
		Builder builder = new AlertDialog.Builder(this).setIcon(R.drawable.ic_dialog_menu_generic).setTitle(
				R.string.pref_about);
		View view = getLayoutInflater().inflate(R.layout.about, null);
		TextView info = (TextView) view.findViewById(R.id.about_info);
		info.setText(Html.fromHtml(getString(R.string.about_info, getVersionNumber(this))));
		builder.setView(view);

		builder.setNegativeButton(R.string.btn_close, new OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
			}
		});

		return builder.create();
	}
	
	return null;
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:22,代码来源:CommonPrefs.java

示例3: showAlert

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static AlertDialog showAlert(final Context context, final String msg, final String title) {
	if (context instanceof Activity && ((Activity) context).isFinishing()) {
		return null;
	}

	final Builder builder = new AlertDialog.Builder(context);
	builder.setIcon(R.drawable.ic_dialog_alert);
	builder.setTitle(title);
	builder.setMessage(msg);
	builder.setPositiveButton(R.string.app_ok, new DialogInterface.OnClickListener() {

		@Override
		public void onClick(final DialogInterface dialog, final int which) {
			dialog.cancel();
		}
	});
	final AlertDialog alert = builder.create();
	alert.show();
	return alert;
}
 
开发者ID:linsir6,项目名称:TripBuyer,代码行数:21,代码来源:MMAlert.java

示例4: changeTextDirection

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
开发者ID:Andy-Ta,项目名称:COB,代码行数:11,代码来源:Notification.java

示例5: run

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
@Override
public void run() {
    Builder builder = new Builder(InCallActivity.this);
    Resources r = getResources();
    builder.setTitle("ZRTP supported by remote party");
    builder.setMessage("Do you confirm the SAS : " + sasString);
    builder.setPositiveButton(r.getString(R.string.yes), this);
    builder.setNegativeButton(r.getString(R.string.no), this);

    AlertDialog backupDialog = builder.create();
    backupDialog.show();
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:InCallActivity.java

示例6: createDialog

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
private Dialog createDialog(int titleId, int textId, boolean twoButtons) {
	Builder builder = new AlertDialog.Builder(this).setIcon(R.drawable.ic_dialog_menu_generic).setTitle(titleId)
			.setMessage(textId);
	if (twoButtons) {
		builder.setPositiveButton(R.string.btn_accept, this);
		builder.setNegativeButton(R.string.btn_calcel, this);
	} else {
		builder.setNeutralButton(R.string.btn_close, this);
	}
	return builder.create();
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:12,代码来源:CommonPrefs.java

示例7: getCommonStructure

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static Dialog getCommonStructure(final Context context, String messageStr,
    DialogInterface.OnClickListener positiveListener) {
    Builder builder = new Builder(context);
    builder.setMessage(messageStr);
    builder.setPositiveButton(R.string.yes_button_txt, positiveListener)
        .setNegativeButton(R.string.no_button_txt, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
    return builder.create();
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:13,代码来源:CommonDialogs.java

示例8: onClick

import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
@Override
public void onClick() {
	if(getOnPreferenceClickListener()==null){

		mCurrentDirectory =new File("/");
		final EditText ed = new EditText(getContext());
		ed.setText(getSharedPreferences().getString(getKey(), defaultBlocklist));
		Builder b = new Builder(getContext());
		b.setTitle(R.string.torrent_blocklist_url);

		b.setView(ed);
		b.setNegativeButton(android.R.string.cancel, null);
		b.setPositiveButton(android.R.string.ok, new OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int which) {
				if(ed.getText().toString().isEmpty()){
					showErrorDialog(getErrorString(-3));
					return;
				}
				//trying to download
				Uri uri = Uri.parse(ed.getText().toString());
				String path = "";
				String query = "";
				try {
					if(uri.getPath()!=null)
						path= URLEncoder.encode(uri.getPath(), "UTF-8").replace("+", "%20").replace("%2F", "/");
					if(uri.getQuery()!=null){
						
						for(String param : uri.getQueryParameterNames()){
							if(!query.isEmpty())
								query+="&";
							query+=URLEncoder.encode(param, "UTF-8")+"=";
							query+=uri.getQueryParameter(param);
								
						}
					}
				} catch (UnsupportedEncodingException e) {
					return;
				}

				startDownload(uri.getScheme()+"://"+uri.getHost()+path+(!query.isEmpty()?"?"+query:""));

			}


		});
		od =b.create();

		od.show();
	}
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:52,代码来源:TorrentBlocklistDialogPreference.java


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