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 4017166
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:49:41+00:00 2026-05-20T09:49:41+00:00

I load images in webview and would like to switch between them by fling

  • 0

I load images in webview and would like to switch between them by fling gesture, but implementing gesture detector in webview case all events are caugth by detector = webview function as zoom and mt dont work. Is there any solution? Filtering events and passing them dow to ontouch? Example code very apreciated.

Thanks to all.

  • 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-20T09:49:42+00:00Added an answer on May 20, 2026 at 9:49 am

    The key to this is to check the return value from gestureDetector.onTouchEvent and, if gestureDetector did not handle the event, then pass it on to the WebView superclass. Also, be sure to return “false” from your onDown method even if you do something with it, so the superclass can initialize its internal state. If your onFling method handles the event, return “true”, otherwise return “false” so the default methods can apply.

    public class FlingView extends WebView implements OnGestureListener {
    
        private GestureDetector gestureDetector;
    
        public FlingView(Context context) {
            super(context);
            init();
        }
    
        public void init() {
            gestureDetector = new GestureDetector(this.getContext(), this);
        }
    
        @Override
        public boolean onTouchEvent(MotionEvent e) {
            return (
            gestureDetector.onTouchEvent(e) || super.onTouchEvent(e));
        }
    
        /* OnGestureListener events */
    
        public boolean onDown(MotionEvent e1) {
            // Initialize event here
            ...
    
            // give the superclass a chance at tap events
            return false;
        }
    
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
        float velocityY) {
            if (test) {
                // handle fling
                ...
                return true;
            } else {
                // let superclass handle the event
                return false;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webView and I use [NSURLRequest requestWithURL:] to load the page. But
I am implementing a webview based application, in that I tried to load an
I have a large Png image file that I would like to display and
I have a html file saved in memory and this file have some images
I have a WebView where the user can click on links and it will
I am looking for an elegant way to access local files (either on phone
Is it possible to refer to an external file [not present in the res/raw
I have this UIWebView on my app that shows a local html file. Do
For some reason, I cannot get a UIWebView to play nice with my new
I'm working on an RSS reader app for Android. I have it to where

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.