AlertDialog.Builder setPositiveButton - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AlertDialog.Builder setPositiveButton method.

This code example shows how to use the following methods:setIcon, setNegativeButton, setPositiveButton, setView
		view.setPadding(Math.round(mColorPicker.getDrawingOffset()), 0, Math.round(mColorPicker.getDrawingOffset()), 0);
 
		final int val = getValue();
		mColorPicker.setColor(val, true);
		mColorPicker.setAlphaSliderVisible(mAlphaSliderEnabled);
		builder.setView(view);
		builder.setIcon(new BitmapDrawable(context.getResources(), getColorPreviewBitmap(context, val)));
		builder.setPositiveButton(android.R.string.ok, this);
		builder.setNegativeButton(android.R.string.cancel, null);
	} 
 
	@Override 
	protected void onSetInitialValue(final boolean restoreValue, final Object defaultValue) {
		if (isPersistent() && defaultValue instanceof Integer) {
			persistInt(restoreValue ? getValue() : (Integer) defaultValue);
		} 
	} 
 
	private int getValue() { 
		try { 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:create, setMessage, setPositiveButton, setTitle
		} 
 
		protected void loginFail(String message) {
			if (dialog != null && dialog.isShowing()) {
				dialog.cancel();
				AlertDialog.Builder builder = new Builder(context);
				builder.setMessage(message);
				builder.setTitle("登录失败!");
 
				builder.setPositiveButton("确定",
						new android.content.DialogInterface.OnClickListener() {
							@Override 
							public void onClick(DialogInterface dialog,
									int which) {
								dialog.dismiss();
							} 
						}); 
				builder.create().show();
			} 
		} 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setCancelable, setIcon, setMessage, setPositiveButton, setTitle
                    .getClientMessageResourceId()); 
        } else { 
            screenMessage = error.getLocalizedMessage();
        } 
 
        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
        builder.setTitle(title);
        builder.setMessage(screenMessage);
        builder.setIcon(android.R.drawable.ic_dialog_alert);
        builder.setCancelable(false);
        builder.setPositiveButton(activity.getString(android.R.string.ok), new OnClickListener() {
 
            @Override 
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            } 
        }); 
 
        return builder;
    } 
9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:create, setCancelable, setIcon, setMessage, setPositiveButton
     * @param iconResourceId 
     * @return 
     */ 
    public static AlertDialog newMessageDialog(final Context context, String dialogTitle,
            String screenMessage, int iconResourceId) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setCancelable(false);
        builder.setPositiveButton("Okay", new OnClickListener() {
 
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            } 
        }); 
 
        builder.setTitle(dialogTitle);
        builder.setMessage(screenMessage);
        builder.setIcon(iconResourceId);
 
        return builder.create();
    } 

9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:create, setMessage, setPositiveButton, setTitle
  } 
 
  public Dialog onCreateDialog(Bundle paramBundle)
  { 
    Context localContext = al.d(getActivity());
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(localContext);
    localBuilder.setTitle(getString(2131493555));
    localBuilder.setMessage(2131493556);
    localBuilder.setPositiveButton(2131492965, new v(this, localContext));
    AlertDialog localAlertDialog = localBuilder.create();
    localAlertDialog.setInverseBackgroundForced(true);
    localAlertDialog.setCanceledOnTouchOutside(true);
    return localAlertDialog;
  } 
} 
 
/* Location:           C:\Users\sandrocheng.21KUNPENG\Desktop\classes_dex2jar.jar 
 * Qualified Name:     com.avast.android.mobilesecurity.app.filter.LGWarningDialog 
 * JD-Core Version:    0.6.2 
 */ 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:create, setMessage, setNegativeButton, setPositiveButton, setTitle
import android.content.DialogInterface.OnClickListener; 
 
public class AlertDialogFactory { 
	public static AlertDialog getConfirmDialog(Context ctx, String title,
			String msg, final DialogCallback ok) {
		AlertDialog.Builder builder = new Builder(ctx);
		builder.setTitle(title);
		builder.setMessage(msg);
		builder.setPositiveButton("确定", new OnClickListener() {
 
			public void onClick(DialogInterface dialog, int which) {
				ok.execute();
			} 
		}); 
		builder.setNegativeButton("取消", new OnClickListener() {
			 
			public void onClick(DialogInterface dialog, int which) {
				ok.cancle();
			} 
		}); 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:create, setMessage, setNegativeButton, setPositiveButton, setTitle
{ 
	public static void dialogBuilder( Activity instance, String title, 
			String message,
			final DialogCallBack callBack)
	{ 
        AlertDialog.Builder builder = new Builder(instance);
        builder.setMessage( message );  
        builder.setTitle( title );  
        builder.setPositiveButton("OK",  
        new android.content.DialogInterface.OnClickListener() 
        {   
            public void onClick(DialogInterface dialog, int which) {  
                dialog.dismiss();  
                callBack.callBack();
            }   
        });  
         
        builder.setNegativeButton("Cancel",  
        new android.content.DialogInterface.OnClickListener() 
        {   

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:create, setIcon, setMessage, setNegativeButton, setPositiveButton
This code example shows how to use the following methods:create, setMessage, setNegativeButton, setPositiveButton, setTitle
	 */ 
	public static void dialogBuilder(Activity instance, String title, 
			String message,
			final DialogCallBack callBack)
	{ 
        AlertDialog.Builder builder = new Builder(instance);
        builder.setMessage(message);  
        builder.setTitle(title);  
        builder.setPositiveButton("确认",  
        new android.content.DialogInterface.OnClickListener() 
        {   
            public void onClick(DialogInterface dialog, int which) {  
                dialog.dismiss();  
                callBack.callBack();
            }   
        });  
         
        builder.setNegativeButton("取消",  
        new android.content.DialogInterface.OnClickListener() 
        {   

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setMessage, setNegativeButton, setPositiveButton, setTitle, show
	private void ExitSystem() { 
		ShowExitDialog(); 
	} 
	 
	private void ShowExitDialog() { 
		LogoutDialogBuilder = new AlertDialog.Builder(LoginUI.this);
		LogoutDialogBuilder.setTitle("�˳���ʾ");
		LogoutDialogBuilder.setMessage("�����Ƿ���Ҫ�˳�\n�ǣ��밴ȷ��\n�����밴ȡ��");
		LogoutDialogBuilder.setPositiveButton("ȷ��", new DialogPositiveButtonListener());
		LogoutDialogBuilder.setNegativeButton("ȡ��", null);
		LogoutDialogBuilder.show();
	} 
	 
	private void DisplayErrorMessage() { 
		Toast.makeText(this, "�û�������������", Toast.LENGTH_SHORT).show();
	}	 
	 
	class ButtonListener implements OnClickListener
	{ 
		@Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related AlertDialog.Builder setPositiveButton Questions & Answers:

Other AlertDialog.Builder setPositiveButton Examples

64:	         dialog.setTitle(item.getTitle());
65:	         dialog.setMessage(item.getSnippet());
66:	         dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
67:	 			public void onClick(DialogInterface dialog, int which) {
68:	 			}

Read More

161:	
162:			// On pressing Settings button
163:			alertDialog.setPositiveButton("Settings",
164:					new DialogInterface.OnClickListener() {
165:						public void onClick(DialogInterface dialog, int which) {

Read More

160:	 
161:	        // On pressing Settings button
162:	        alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
163:	            public void onClick(DialogInterface dialog,int which) {
164:	            	Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);

Read More

setPositiveButton Method Overview
Set a listener to be invoked when the positive button of the dialog is pressed.
See Code Examples for other Android AlertDialog.Builder Methods: