Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. imageView.setOnTouchListener(new View.OnTouchListener() {
  2. @Override
  3. public boolean onTouch(View v, MotionEvent event) {
  4.  
  5. switch (event.getAction()) {
  6. case MotionEvent.ACTION_DOWN: {
  7. v.setBackgroundColor(Color.LTGRAY);
  8. Log.i("Relative", "On Touch");
  9. break;
  10. }
  11. case MotionEvent.ACTION_UP:
  12. case MotionEvent.ACTION_CANCEL: {
  13. v.setBackgroundColor(Color.TRANSPARENT);
  14. Log.i("Relative", "No Touch");
  15. break;
  16. }
  17. }
  18.  
  19. return false;
  20. }
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement