Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...
by CHAKYANAS » Sun Mar 23, 2008 3:44 pm
[align=center]
Simple TouchEvent Example Code[/align]
Using java Syntax Highlighting
public boolean dispatchTouchEvent(MotionEvent ev){
int action = ev.getAction();
switch(action){
case MotionEvent.ACTION_UP:
int X = (int)ev.getX();
int Y = (int)ev.getY();
checkInRange(X,Y);
if( flag_for_Range==1)
screencordToLat(X,Y);
break;
}
return false;
}
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
-

CHAKYANAS
- Developer

-
- Posts: 44
- Joined: Mon Mar 03, 2008 5:08 am
- Location: INDIA
-
by androidonkey » Mon Mar 31, 2008 9:54 am
CHAKYANAS,
Thanks for this code snippet. It works quite well.
- androidonkey
-
androidonkey
- Junior Developer

-
- Posts: 13
- Joined: Mon Feb 18, 2008 10:20 am
Return to Novice Tutorials
Who is online
Users browsing this forum: No registered users and 8 guests