Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6340829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:54:36+00:00 2026-05-24T19:54:36+00:00

I have hooked in a ScaleGestureDetector to an OnTouchListener as instructed in Android documentation.

  • 0

I have hooked in a ScaleGestureDetector to an OnTouchListener as instructed in Android documentation. For some reason the ScaleGestureDetector does not always detect end of a pinch gesture. This happens mostly when pinching fast from large to small.

The effect is that after I have released both fingers the detector does not fire the gesture end event. If I touch the screen with one afterwards it still thinks I’m continuing the scale gesture (keeps firing onScale events). I have to do another gesture to get the detector to fire end event.

I have added logs to the OnTouchListener and when the scale gesture gets stuck I still get motion events normally when using one finger and event.getPointerCount() is 1.

I have made sure that I don’t have any other listeners intervening. View that has the onTouchListener is not the only view on screen but this effect happens also when I’m very careful to begin and end the gesture inside this one view.

Is there any way to improve the end detection?

Or if there a way for me to manually set the ScaleGestureDetector to fire onScaleEnd and change scaleGestureDetector.isInProgress() to false?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:54:37+00:00Added an answer on May 24, 2026 at 7:54 pm

    I came up with a solution, after applying the above fix. My application uses both a ScaleGestureDetector and a normal GestureDetector so I implemented in my onScroll method (from the GestureDetector):

    if (m_dualFingerGestureDetector.isInProgress() && (evt1.getPointerCount() == 2 || evt2.getPointerCount == 2)
    {
        return false;
    }
    ...
    

    My variables are as follows:

    m_dualFingerGestureDetector is my ScaleGestureDetector
    evt1 and evt2 are MotionEvents for a drag gesture. If you only have one event, you can shorten the above code:

    if (m_dualFingerGestureDetector.isInProgress() && evt.getPointerCount() == 2)
    {
        return false;
    }
    ...
    

    This allows very nice user interfaces to be built. I would always recommend using the combination of gesture detectors to add pan-and-zoom features to your app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the PureMVC framework on a FlexBuilder 3 project. I have already hooked
How can I set a parameter of a sub-report? I have successfully hooked myself
I have 2 keyboards hooked up to my machine (one on PS/2, the other
If I have a printer hooked directly to a pc (a kiosk with a
I have an Ajax site where I have browser navigation hooked up to ajax
Can I have multiple web servers hooked up to a SQL Server cluster and
I have a NSWindow that hosts a WebView that Ive hooked up to a
I have a form that is closed unexpectedly immediately after showing it. I hooked
I have two models, Design and Profile . Profile is hooked up in settings.py
I have NHibernate hooked up in my asp.net mvc application The ISession is injected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.