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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:37:28+00:00 2026-05-25T16:37:28+00:00

In my app I have inflated a ListView with this row: <?xml version=1.0 encoding=utf-8?>

  • 0

In my app I have inflated a ListView with this row:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:gravity="center"
    android:orientation="horizontal" android:layout_height="wrap_content"
    android:id="@+id/rootrow_layout" android:clickable="true"
    android:focusable="true" android:focusableInTouchMode="true">
    <LinearLayout android:layout_height="fill_parent"
        android:id="@+id/containerHistory" android:layout_width="fill_parent"
        android:layout_weight="1">
        <LinearLayout android:layout_weight="1"
            android:orientation="vertical" android:layout_gravity="center"
            android:layout_height="wrap_content" android:layout_width="wrap_content"
            android:layout_marginLeft="2dip">
            <LinearLayout android:id="@+id/LinearLayout02"
                android:layout_height="wrap_content" android:layout_width="fill_parent">
                <TextView android:textSize="16sp" android:gravity="left"
                    android:padding="5dp" android:layout_width="fill_parent"
                    android:text="Unknown location " android:id="@+id/historyLocation"
                    android:layout_height="wrap_content" android:textColor="#000000"></TextView>
            </LinearLayout>
            <LinearLayout android:id="@+id/LinearLayout03"
                android:layout_height="wrap_content" android:layout_width="fill_parent">
                <TextView android:layout_weight="1" android:textSize="12sp"
                    android:gravity="left" android:padding="5dp" android:layout_width="fill_parent"
                    android:text="Complete" android:typeface="serif" android:id="@+id/historyDate"
                    android:layout_height="wrap_content" android:textColor="#000000"></TextView>
            </LinearLayout>
            <LinearLayout android:id="@+id/LinearLayout04"
                android:layout_height="wrap_content" android:layout_width="wrap_content"></LinearLayout>
        </LinearLayout>
    </LinearLayout>
    <LinearLayout android:orientation="vertical"
        android:layout_marginRight="2dip" android:id="@+id/linearLayout1"
        android:layout_height="match_parent" android:layout_width="wrap_content">
        <CheckBox android:id="@+id/check" android:layout_gravity="center"
            android:layout_height="fill_parent" android:layout_width="wrap_content"></CheckBox>
    </LinearLayout>

</LinearLayout>

Now I would add an event (OnClickListener) on my root layout. I can get the event but I can’t see the default selector (for example I have Galaxy S2 and on list click I have a blue background).

Can I set the default selector on LinearLayout click event?

I attach a screenshot for my default selector on Galaxy S2.
Galaxy S2 ListView item selector


Sorry, I’ve tried solution:

@android:drawable/list_selector_background

  • 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-25T16:37:29+00:00Added an answer on May 25, 2026 at 4:37 pm

    Modify your root LinearLayout to become like this (NOTICE THE LAST LINE!)

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:gravity="center"
        android:orientation="horizontal"
        android:layout_height="wrap_content"
        android:id="@+id/rootrow_layout"
        android:clickable="true"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:background="@android:drawable/list_selector_background">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following main.xml for my app. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have in my app a ListView with adapter , I use this to
I have been attempting to use an android.preference.DialogPreference inflated from XML, but the documentation
This is a continuation of the question here: JBoss - does app have to
In my qt app I have this object, filled before setting up my QTreeWidget's
This is my code: package com.example.testcode; import android.app.ListFragment; import android.app.LoaderManager; import android.content.CursorLoader; import android.content.Loader;
I'm making an Android app and have a strange problem. I need a ViewFlipper
I have a ListView in my ListActivity which is inflated with an adapter. There
I have a an Android ListView that has small (say, 1-5 frame) stutters as
I'm writing an Android app that is basically a ListView populated with an array

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.