0

I have the ImageView witch we can Zoom in and zoom out. I want to handle the LongClick event on that ImageView. How can I do this. Is this possible?

Raga
  • 43
  • 1
  • 1
  • 5

2 Answers2

1
ImageView imageView = (ImageView) findViewById(R.id.ImageView);
    imageView.setOnLongClickListener(new OnLongClickListener() {

        @Override
        public boolean onLongClick(View v) {
            Toast.makeText(getBaseContext(), "image long clicked", Toast.LENGTH_LONG).show();
            zoomOut()/zoomIn();
            return true;
        }
    });
Nuno Gonçalves
  • 6,202
  • 7
  • 46
  • 66
  • I already did this but every times control goes to the onTouchListener instead of onLongClickListener. Is there any Motioevent related to Long touch in onTouchListener?? – Raga Jun 13 '12 at 15:32
0

You can see the way to handle onLongClick of Nuno Goncalves for Image View. To zoom-in, zoom-out image view, you can see this link: Android imageView Zoom-in and Zoom-Out to understand.

Hope it's clearly.

Community
  • 1
  • 1
secretlm
  • 2,361
  • 2
  • 27
  • 38