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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:25:48+00:00 2026-06-14T02:25:48+00:00

I have been trying to find a solution for this for hours and it

  • 0

I have been trying to find a solution for this for hours and it feels like I searched every question on stackoverflow and tried everything in the layout.
Before I tried the layout displayed below, the edittext and the two imagebuttons were inside the scrollview. In this old layout the ontouch worked perfectly in my fragment, however once I pulled out the relative layout with the edittext and the two image buttons the ontouch was not fired. Can someone help me with this problem? Any help is appreciated. Thanks

View fragmentView = inflater.inflate(R.layout.request, container, false);

fragmentView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {

            }
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"  
        android:layout_height="fill_parent"
        android:background="#BDCCE0" >

    <EditText
        android:id="@+id/etsearch"
        android:layout_width="210dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="6dp"
        android:layout_marginTop="10dp"
        android:hint="search..."
        android:singleLine="true"
        android:imeOptions="actionDone" />

    <ImageButton
        android:id="@+id/bsearch"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/etsearch"
        android:layout_marginTop="9dp"
        android:src="@drawable/search" />

    <ImageButton
        android:id="@+id/bupdaterequests"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_toRightOf="@id/bsearch"
        android:layout_marginTop="9dp"
        android:src="@drawable/refresh" />

  <ScrollView
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:fillViewport="true"
        android:background="#BDCCE0"
        android:layout_below="@id/etsearch" >

   <TableLayout
       android:id="@+id/myTableLayout"  
       android:layout_width="fill_parent"  
       android:layout_height="wrap_content" >    

   </TableLayout> 
 </ScrollView>
</RelativeLayout>
  • 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-14T02:25:49+00:00Added an answer on June 14, 2026 at 2:25 am

    A TouchEvent starts at the “highest” element and trickles “down” the View hierarchy until it is consumed by some event. In this case the ScrollView, Buttons, or EditText all consume the event before it reaches the RelativeLayout…


    basically I only want to that when someone touches outside the edit text the keyboard disappears.

    I addressed this by simply making the root layout clickable and focusable.

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="true"
        android:focusable="true"
        android:focusableInTouchMode="true" >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying for hours to find a solution this problem but have not
I have been trying to find a solution to this one but could not
I have been trying to find a good solution to this problem for a
I have been trying to find a solution for this for a while but
I've been trying to google this but have been unable to find a solution
I have been trying to find a solution for past few hours but unable
I have been trying to find a solution to this everywhere but am stumped.
I have searched on this forum and haven't been able to find a solution
Okay, I have been trying to find a solution for this and I just
I have been trying to find decent Image Acquisition + Image Processing solution at

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.