Code example for LinearLayout.LayoutParams

Methods: setLayoutParams, setMargins

0
		tvT_1.setText("Tap the screen to\nsend a request to the waiter.");
		tvT_1.setWidth(LayoutParams.FILL_PARENT);
		tvT_1.setHeight(40);
		tvT_1.setGravity(Gravity.CENTER_HORIZONTAL);
 
		LayoutParams lPar = new LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT);
		lPar.setMargins(5, 5, 5, 5);
		rLL.setLayoutParams(lPar);
 
		rLL.addView(tvT_1);
		rLL.addView(tvLocation);
 
		rLL.setOnClickListener(this);
	} 
 
	/** 
	 * Activates the Location provider and enables updates reception. 
	 */ 
	private void EnableGPS() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE