Code example for MotionEvent

Methods: getActiongetPointerCountgetXgetY

0
		* @return	void 
		*/ 
		@Override 
		public boolean onTouch( View v , MotionEvent e ) {
			 
			if( e.getPointerCount( ) == 2 ){
 
				switch( e.getAction( ) ){
 
					case MotionEvent.ACTION_DOWN:
 
		            case MotionEvent.ACTION_MOVE:
		            	rotation( e );
		                break; 
 
		            default: 
		            	 
				} 
 
				//rotation( e ); 
			} 
		    return false; 
		} 
 
	// -------o protected 
 
		/** 
		*  
		*  
		* @private 
		* @return	void 
		*/ 
		private void rotation( final MotionEvent ev ) { 
 
	        final double dx = (ev.getX(0) - ev.getX(1));
	        final double dy = (ev.getY(0) - ev.getY(1));
	        final double radians = Math.atan2(dy, dx);  
	        final float res = (float) radians;
	       	HyperTouch.mSurface.queueEvent( 
				new Runnable(){
	                public void run() {  
Stop searching for code, let great code find you!  Add Codota to your java IDE