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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:57:58+00:00 2026-06-07T22:57:58+00:00

I have a RelativeLayout that looks like this: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent

  • 0

I have a RelativeLayout that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#65ffffff" >

<com.sonyericsson.zoom.ImageZoomView
    android:id="@+id/zoomview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />


</RelativeLayout>

I have a bunch of touch events set for that RelativeLayout. However, the com.sonyericsson.zoom.ImageZoomView also have its own logic to handle touch events.

When I perform any touch event in the screen, the touch listeners of the com.sonyericsson.zoom.ImageZoomView class is called first (which is what I expect). The problem is that, if I return “true” in that touch event, the touch listeners of the RelativeLayout ARE NOT CALLED. Whereas if I return “false”, they are called but then, the touch processing that the class ImageZoomView did simply don’t happen! (I guess because I returned “false” in the end, so Android simply ignores any UI updates that the touch events of the class com.sonyericsson.zoom.ImageZoomView previous made).

In short, I want to be able to process the same touch event in both my com.sonyericsson.zoom.ImageZoomView AND in my RelativeLayout.

Is there any way to do that?

I am using Android 2.2+.

Thank you in advance!

  • 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-07T22:58:00+00:00Added an answer on June 7, 2026 at 10:58 pm

    I ended up using the method onInterceptTouchEvent, like below :

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
    
            return onTouchEvent(ev);
    }
    

    I had to implement the method onTouchEvent to return “false”:

    @Override
    public boolean onTouchEvent(MotionEvent event) {
    
          gesturedetector.onTouchEvent(event);      
       return false;
    }
    

    That way I was able to intercept the events BEFORE they get send to the children. So, I made de processing I wanted before that.

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

Sidebar

Related Questions

In my foo_layout.xml file I have a subclassed RelativeLayout: <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following layout file: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:background=#FF0000
This is my Android list_item layout XML: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=wrap_content android:layout_height=fill_parent android:paddingRight=?android:attr/scrollbarSize android:background=@drawable/list_bg> <TextView
I have a base view in XML. <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content"><TextView android:layout_height="wrap_content" android:layout_width="fill_parent"
I have a RelativeLayout with one child as <include another.xml> like this root.xml :
I have a list view that looks like this and that's its code ..
All- I have a layout that looks like this: My goal is to have
So, I have a relative layout that looks like this: ImageView TextView1 TextView2 Suppose,
I thought I have understood the XML layout of Android, but it seems that
I am developing an Android app (see screenshots). I have a layout that looks

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.