Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
levanphong7887
Posts: 114
Registered: ‎10-21-2010
My Device: Bold 9650
My Carrier: Develper
Accepted Solution

Can not handle Pinch Zoom event?

Hi all,

 

I'm using the following sample to hadle Pinch Zoom event.

 

protected boolean touchEvent(TouchEvent message) 
{
   switch(message.getEvent()) 
   {
      case TouchEvent.GESTURE:
         TouchGesture gesture = message.getGesture();
         switch(gesture.getEvent()) 
         {
           case TouchGesture.PINCH_END:
             Dialog.alert("Focal point: " + message.getX(1) 
             +            ", " + message.getY(1)
             +            "\nFinal zoom value: " + gesture.getPinchMagnitude());
             return true;
         }
   }
   return false;
}

But it's not woked for me. I put the break point and it never hit it. My app can not handle this event.

 

Someone can tell me why?

Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Can not handle Pinch Zoom event?

Is touchEvent being called at all, or just not your pinch code? Where are you overriding touchEvent? Do you have other fields on the screen that may be capturing the event?

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Please use plain text.
Trusted Contributor
levanphong7887
Posts: 114
Registered: ‎10-21-2010
My Device: Bold 9650
My Carrier: Develper

Re: Can not handle Pinch Zoom event?

Thank you!
I have just found the reason that I haven't enabled pinch gestures.
Please use plain text.