Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- imageView.setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN: {
- v.setBackgroundColor(Color.LTGRAY);
- Log.i("Relative", "On Touch");
- break;
- }
- case MotionEvent.ACTION_UP:
- case MotionEvent.ACTION_CANCEL: {
- v.setBackgroundColor(Color.TRANSPARENT);
- Log.i("Relative", "No Touch");
- break;
- }
- }
- return false;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement