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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:24:27+00:00 2026-05-22T21:24:27+00:00

My app is based on a tabbed layout where each tab is assignes a

  • 0

My app is based on a tabbed layout where each tab is assignes a FragmentActivity.
One of this activities has the following layout:

<FrameLayout
android:id="@+id/filialenView"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">

<ListView android:layout_height="wrap_content" android:id="@+id/filialList"
  android:layout_width="fill_parent"></ListView>

</FrameLayout>

When switching to that tab, a list is created and shown.
If a list item is selected, a Fragment is created and shown on top of the list:

    Filiale fragment = new Filiale();
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

    fragmentTransaction.replace(R.id.filialenView, fragment);

    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();

The layout “filial_detail.xml” for Fragment Filiale looks like

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
 ... content...
</LinearLayout>

and is inflated in onCreateView like this

View curView = inflater.inflate(R.layout.filial_detail, container, false);

Everything works like expected, except that after switching to the Fragment, the nomore visible list seems to keep input focus. If I touch the screen in some “empty” area, the hidden list item behind the fragment triggers. Also, if I swipe, I can see from LogCat output, that the list scrolls.
Based on my understanding of FrameLayout, it should be ok to stack views like this.

What’s wrong with that code?

Since there’s no answer or comment yet, a more general question:
Is there any known situation where a view in background is supposed to receive input or is that wrong behaviour in any case?

  • 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-22T21:24:28+00:00Added an answer on May 22, 2026 at 9:24 pm

    The reason for this behaviour is that ViewGroups by default don’t handle input events, but pass them through to widgets behind them, if there are any.
    In my given code, the list has height “wrap_content”, thus the remaining vertical area is covered only by the LinearLayout element which passes input through to the hidden fragment.
    The behaviour I wanted can be achieved by

    • setting the height of the listView to “fill_parent”
      or
    • adding an OnClickListener to the LinearLayout with an empty onClick method
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got android app based on 2 activities. The Main activity is just a
In my Android app, I have a tabbed Activity . In one of the
I'm looking to create an app based on the OSGi model. One of the
I am making an Android app based on in app purchase. In my app
At this moment I think about authentication in my web app based on Strust2.
I am writing an App based on UITabBarController which has more than 10 viewControllers
Hi I'm setting up an android app and I'm using a tabbed interface. I'd
I have an app based on a tab bar and data retrieved from the
I build an app based on this site http://msdn.microsoft.com/en-us/library/dd633661%28v=EXCHG.80%29.aspx appointment.Subject = "Status Meeting"; appointment.Body
I am developing an app based on date and time in java. In this

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.