Code example for RelativeLayout

Methods: setBackgroundColorsetOnTouchListener

0
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		// remove notification bar 
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		 
		layout = new RelativeLayout(this);
		layout.setBackgroundColor(0xFFFFFF00);
		layout.setOnTouchListener(new View.OnTouchListener() {
			 
			@Override 
			public boolean onTouch(View view, MotionEvent event) {
				// TODO Auto-generated method stub 
				int action = event.getAction();
				PointerCoords curCoord = new PointerCoords();
				event.getPointerCoords(0, curCoord);
				Calendar calendar = Calendar.getInstance();
				long curTime = calendar.getTimeInMillis();
				switch(action) {
				case MotionEvent.ACTION_DOWN:
					xTouchDown = event.getAxisValue(MotionEvent.AXIS_X);// curCoord.x;
Stop searching for code, let great code find you!  Add Codota to your java IDE