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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:31:07+00:00 2026-06-09T02:31:07+00:00

My onScroll and are onTouchEvent getting called, but not the onDown method. In fact,

  • 0

My onScroll and areonTouchEvent getting called, but not the onDown method. In fact, when I log the distaceX in onDown I get several of them logged out, and the first is always relative to the spot where I ended the last scroll.

 @Override 
 public boolean onTouchEvent(MotionEvent me){ 
   this.detector.onTouchEvent(me);

  return super.onTouchEvent(me); 
 }

 @Override
 public boolean onDown(MotionEvent e) {
       Log.d("---onDown---",".");
   return false;

 }

 @Override
 public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
   float distanceY) {
  Log.d("---onScroll---", "" + distanceX);
  return false;
 }

Any ideas why onDown would not be called?

EDIT:

I changed my onTouchEvent to the following block, and only the ACTION_MOVE gets logged.

 float gestureDistance = 0;
 @Override 
 public boolean onTouchEvent(MotionEvent me){ 
     switch (me.getAction() & MotionEvent.ACTION_MASK) {
        case MotionEvent.ACTION_DOWN:               
            Log.d("actionDown", "gestureDistance:" + gestureDistance);
            break;
        case MotionEvent.ACTION_UP:
            Log.d("actionUp", "gestureDistance:" + gestureDistance);
            break;
        case MotionEvent.ACTION_MOVE:
            Log.d("actionMove", "gestureDistance:" + gestureDistance);
            break;
        default:
            Log.d("action default", "default");
            break;
    }   

EDIT:
I think the problem is that my view is a WebView. Can I keep the webview from stealing my events?

  • 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-06-09T02:31:08+00:00Added an answer on June 9, 2026 at 2:31 am

    Adding this to my onCreate fixed the problem.

        webView.setOnTouchListener(new View.OnTouchListener() {
    
            public boolean onTouch(View v, MotionEvent event) {
               detector.onTouchEvent(event);
                return true;
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with the onScroll event of the OnGestureListener. the method signature
The onScroll event is not yet supported by the iScroll4 . Is there a
I am using the onScroll method of GestureDetector.SimpleOnGestureListener to scroll a large bitmap on
This is working : http://jsfiddle.net/9NDXF/1/ when I write onmousemove, but this is not :
Can one use Window.Onscroll method to include detection of scroll direction?
Possible Duplicate: Create event handler for OnScroll for web browser control I would like
I am trying to trigger the onScroll event this way using prototype: Event.observe(document, 'scroll',
i'm doing something of the sort of an infinite gallery. my OnScroll function detects
What is the difference of events of onFling() and onScroll() of android.view.GestureDetector.OnGestureListener? link text
I am using the fromPixels() function in osmdroid (3.05) like so: public boolean onScroll(ScrollEvent

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.