Mtouchlistener = new ontouchlistener () {<br/> @ override <br/> Public Boolean ontouch (view V, motionevent event) {<br/> // todo auto-generated method stub <br/> float x = event. getxprecision () * event. getx () + event. getx (); <br/> float y = event. getyprecision () * event. gety () + event. gety (); <br/> switch (event. getaction () {<br/> case motionevent. action_down: </P> <p> break; <br/> case motionevent. action_move: <br/> mtouchtimes ++; <br/> If (mtouchtimes> touch_times) {<br/> // calculation Angle Based on the direction <br/> If (mcurrentorientation = deviceorientation. landscape) {<br/> mangle = math. todegrees (math. atan2 (Y-480/2, x) + 90; <br/>}else {<br/> mangle =-math. todegrees (math. atan2 (Y-480/2, 320-x) + 90; <br/>}</P> <p> log. W ("angle", "mangle:" + mangle); <br/>}< br/> break; <br/> case motionevent. action_up: <br/> If (mtouchtimes> touch_times) {</P> <p >}else {</P> <p >}< br/> mtouchtimes = 0; <br/> break; <br/> default: <br/> break; <br/>}< br/> return true; <br/>}< br/>}; <br/> mview. setontouchlistener (mtouchlistener );