當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。