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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:40:22+00:00 2026-05-13T23:40:22+00:00

Actually I’m trying to implement an ontouchlistener into my android (1.5) application. therefore i

  • 0

Actually I’m trying to implement an ontouchlistener into my android (1.5) application.
therefore i implemented the “ontouchlistener” into the class, and then i put my code into the:

public boolean onTouchEvent (MotionEvent e){
 //code
}

The problem is, that if I am dragging over an (e.g.) Spinner or EditTextView than this Method isn’t called. The only way to solve this which i figured out is to add an ontouchlistener to each of this views manually:

((Spinner)(findViewById(R.id.spinner1))).setOnTouchListener(tl);
((Spinner)(findViewById(R.id.spinner2))).setOnTouchListener(tl);

(tl is the ontouchlistener)
So isn’t there a way to catch the touch event before it gets to each of those views?
thanks in advance

Ripei

  • 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-13T23:40:22+00:00Added an answer on May 13, 2026 at 11:40 pm

    What exactly do you want to do – do you want to:

    • Detect whole gestures in some
      Activity.
    • Detect touches only for a given
      View

    If you want the former:

    Take a look at this example:
    Fling gesture detection on grid layout.

    Basically, you redirect all registered touch events to a GestureDetector.
    It understands what exactly is the user input (single tap, double tap, scroll, etc.) and calls the corresponding callback in a SimpleOnGestureListener, which you should implement.

    If you want the latter:

    You can either:

    1. Override the View’s onTouchEvent().
    2. Implement and hook onTouchListener (if you want to get the touch before it’s dispatched to it).

    If you want to implement onTouchListener, you’ll be doing your work not in the onTouchEvent() method, but in the interface’s onTouch() method.

    Hope that helps.

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

Sidebar

Related Questions

Actually i have trying to put an ajax loader in my application. I tried
Actually, I am facing a problem in Android. I am creating an application that
Actually i'm trying to show and dialog into a parent form, An reference example
Actually i am unable to access internet in android emulator. when i am trying
Actually I am developing one application in that when application run first time it
Actually I am stuck in middle of some mysql code. Can anyone suggest a
Actually ,i am working on a livechat application its works fine.This application is tabbed
Actually this is my code: echo <pre>; // get current vars $p1 = isset($_GET['p1'])
Actually, I want to create an application in C such that 2 people can
Actually i want to implement swipe left and right in UIScrollview. i have scrollview

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.