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

  • Home
  • SEARCH
  • 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 4603782
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:12:06+00:00 2026-05-22T00:12:06+00:00

Is it possible to detect all touch events in an Activity and capture it

  • 0

Is it possible to detect all touch events in an Activity and capture it and then in return pass that pass event to another View?

For example:

Button 1 and Button 2. When Button 1 is pressed I want to capture that touch/click event and automatically pass that touch event to Button 2, basically with one touch/press you get the click generated and that same click is passed on to the second button automatically.

  • 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-22T00:12:07+00:00Added an answer on May 22, 2026 at 12:12 am

    take look this API description first.


    boolean
    android.app.Activity.dispatchTouchEvent(MotionEvent
    ev)

    public boolean dispatchTouchEvent
    (MotionEvent ev) Since: API Level 1
    Called to process touch screen events.
    You can override this to intercept all
    touch screen events before they are
    dispatched to the window. Be sure to
    call this implementation for touch
    screen events that should be handled
    normally.

    Parameters ev The touch screen event.

    Returns boolean Return true if this
    event was consumed.

    As you can see, you can intercept all touch events.

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        // TODO Auto-generated method stub
        super.dispatchTouchEvent(ev);
        if(btn1.onTouchEvent(ev)){
            return btn2.onTouchEvent(ev);
        }else{
            return false;
        }
    }
    

    These codes are what you are looking I think.

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

Sidebar

Related Questions

All I know is that it is not possible to detect any wireless computer
Is it possible to detect a valid regular expression with another regular expression? If
Is it possible to detect the specific webcam hardware that a person is using
Is it possible to detect that the user has an external headset plugged into
Is it possible to detect that whether any modal dialog box is open over
Is it at all possible to detect when your application stops responding, so appropriate
I need to build ONE regular expression that can detect ALL the following strings
How to detect all music on a harddrive, then copy it to a folder
I would like to detect all time like strings in a webpage, and then
Possible Duplicate: Detect all changes to a <input type=text> (immediately) using JQuery I have

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.