File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Double tap to zoom on ImageView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Double tap to zoom on ImageView" Watch "Double tap to zoom on ImageView" New topic

Double tap to zoom on ImageView

Adam Schweitzer

Joined: May 26, 2006
Posts: 17
I am trying to implement zoom functionality on an ImageView, similar to the built-in Photos app on iOS (I don't have a physical android device to make a more suitable analogy). Pinch-to-zoom would be nice to have, but zoom on double-tap is essential.

I've tried some sample code (ex., but this does not work for me, for some reason; none of the event handlers fire (I may be omitting something simple?).

Can someone point me in the right direction?

For troubleshooting purposes, I used sample code unmodified from the above link, on an Android 2.3 emulator in an application with android:minSdkVersion=7 and the following layout:
It is sorta covered in the JavaRanch Style Guide.
subject: Double tap to zoom on ImageView
It's not a secret anymore!