Code example for LinearLayout.LayoutParams

Methods: setMargins

0
	 * @param listener 
	 */ 
	public void setPositive2Button(String text, final View.OnClickListener listener)
	{ 
		Button button=new Button(mContext);
		LinearLayout.LayoutParams params=new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
		params.setMargins(mMargins, formatDipToPx(mContext, 10), mMargins, 0);
		button.setLayoutParams(params);
		//button.setBackgroundResource(R.drawable.alertdialog_button); 
		button.setText(text);
		button.setTextColor(Color.BLACK);
		button.setTextSize(20);
		button.setOnClickListener(listener);
		mButtonLayout.addView(button, 1);
	} 
  
	/** 
	 * ���ð�ť 
	 * @param text 
	 * @param listener 
Contextual code suggestions in your IDE  Get Codota for Java