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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:39:45+00:00 2026-05-21T20:39:45+00:00

I have a nested series of linear layouts in my xml code. I want

  • 0

I have a nested series of linear layouts in my xml code. I want the first child of the parent (also a linear layout) to take focus. It does this if I set focusable to true. I would also like pass the focus onto the children of this layout (in order to invoke their state-lists). However it does not pass any of it’s focus onto it’s children, even if they are set to focusable. Any ideas how to do this? Thanks

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:weightSum="1"
        android:layout_height="wrap_content"
        android:background="@drawable/resultpage_statelist"
        android:focusable="true"
        android:clickable="true">
        <TextView
            android:text="TextView"
            android:layout_height="wrap_content"
            android:paddingTop="5dip"
            android:paddingBottom="5dip"
            android:paddingLeft="10dip"
            android:layout_width="fill_parent"
            android:layout_weight="0.8"
            android:id="@+id/tag_row_text"
            android:textSize="16dip"
            android:padding="10dip"
            android:textColor="@drawable/resultpage_grey_text_statelist"
            android:background="#00000000"
            android:focusable="true">
        </TextView>
        <ImageView
            android:layout_height="wrap_content"
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_gravity="right|center_vertical"
            android:src="@drawable/arrow_statelist"
            android:layout_marginRight="10dip"
            android:background="#00000000"
            android:focusable="true">
        </ImageView>
    </LinearLayout>
    <LinearLayout
        android:layout_width="fill_parent"
        android:background="#6E6E6E"
        android:layout_height="1dip">
    </LinearLayout>
</LinearLayout>
  • 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-21T20:39:46+00:00Added an answer on May 21, 2026 at 8:39 pm

    Use the XML attribute ‘android:duplicateParentState’ set to true on the child view to get it to inherit the drawable state of its parent.

    More details here: http://developer.android.com/reference/android/view/View.html#attr_android:duplicateParentState

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

Sidebar

Related Questions

I have nested xsl:for loops: <xsl:for-each select=/Root/A> <xsl:for-each select=/Root/B> <!-- Code --> </xsl:for> </xsl:for>
What if I have nested loops, and I want to break out of all
I have some nested tables that I want to hide/show upon a click on
I have a nested movie clip instance that I want to access. The path
I have a series of nested master pages, like so: site.master: <asp:ContentPlaceHolder ID=SearchFormContent runat=server>
I have a series of links nested within a div. When one of those
So I have a series of 2 nested ul's. When you click on the
I have a series of DIVs on a page which each contain a nested
I have a series of nested UL's that are like this: <ul class=categorySelect id=>
So I have a series of nested ul elements as part of a tree

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.