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?
Asked
Active
Viewed 538 times
0
-
1check `setOnLongClickListener()` – Sherif elKhatib Jun 13 '12 at 14:41
2 Answers
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.