Code example for AlertDialog.Builder

Methods: setView

0
		prepareDialog(dialog);
	} 
	 
	public Dialog(Activity activity, int layoutResource) {
		this.activity = activity;
		dialog = new Builder(activity);
		 
		LayoutInflater inflater = LayoutInflater.from(activity);
		view = inflater.inflate(layoutResource, null);
		dialog.setView(view);
		 
		prepareDialog(dialog);
	} 
	 
	abstract protected void prepareDialog(Builder dialog);
	 
	protected static int dip(Context context, int pixels) {
		float scale = context.getResources().getDisplayMetrics().density;
		return (int) (pixels * scale + 0.5f);
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE