Created
April 3, 2011 20:34
-
-
Save codeswimmer/900769 to your computer and use it in GitHub Desktop.
Android: covert the given MotionEvent.getAction() result into a String.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String eventActionToString(int eventAction) { | |
switch (eventAction) { | |
case MotionEvent.ACTION_CANCEL: return "Cancel"; | |
case MotionEvent.ACTION_DOWN: return "Down"; | |
case MotionEvent.ACTION_MOVE: return "Move"; | |
case MotionEvent.ACTION_OUTSIDE: return "Outside"; | |
case MotionEvent.ACTION_UP: return "Up"; | |
case MotionEvent.ACTION_POINTER_DOWN: return "Pointer Down"; | |
case MotionEvent.ACTION_POINTER_UP: return "Pointer Up"; | |
} | |
return ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment