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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:42:50+00:00 2026-05-30T11:42:50+00:00

I have been trying desperately to fix this issue where my ListView items are

  • 0

I have been trying desperately to fix this issue where my ListView items are highlighted. I have reviewed any solution I could find here on stackoverflow, and have found none that work for me.

First off, this is a ListView in a LinearLayout in a ViewPager in a LinearLayout.

Each Item in that Listview is a LinearLayout containing a LinearLayout (Containing a TextView) and a Gallery. The Gallery contains multiple LinearLayouts containing a TextView and Imageview in a FrameLayout.

This problem occurs, not on click but on drag, as when swiping your finger over a story (sometimes while the ListView scrolls with your drag) the item underneath becomes selected. Additionally, this particular problem only occurs on devices where the over-scroll effect does not cause a bounce when scrolling.

Attempts to solve the issue are as follows:

  • Set the List Selector to the Background Color in XML (Fail)
  • Set the List Select to Alpha #00000000 in XML (Fail)
  • The Above but Programatically
  • The Above but by theme
  • Code that sets the selection to -1 onListItemClick
  • Removing the background from list item’s LinearLayout (Works on 4.0)
  • Setting android:cacheColorHint to #00000000 (does nothing?)

I just can’t figure out why it’s doing this and I really need it to stop.

Screenshot of ListView Item being HIghlighted

  • 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-30T11:42:52+00:00Added an answer on May 30, 2026 at 11:42 am

    This was a most interesting problem. The solution of which is even more interesting.

    For some reason, what I didn’t try, and what nobody thought of, was to remove android:background from the LinearLayout for the ListView items.

    Upon removing android:background, the layout continues to display properly and the black no longer appears.

    If you have a problem similar to this that this does not solve, you may want to check the Android Blog: Why is my list black?

    EDIT: This worked fine for ICS, but elicited a much larger problem in 2.1. To completely solve the ordeal, I ended up having to specify android:cacheColorHint="#000000" to the ListView (and the LinearLayout for good measure) in my inline styles as well as in the style definition I applied to the ListView.

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

Sidebar

Related Questions

I have been trying to solve this problem for a while, could not find
Have been trying to fix this problem I have here. Basically I have a
I have been trying to figure this out, but google wasn't turning up any
I have spent three days trying to find the solution to this problem to
I have been trying this for a while but thus far haven't had any
I have been trying to fix my .setText crash issue, which occures when i
I have been trying to find a code snippet to do an unsharp mask
I have been trying to find out why the following lines of code do
I have been trying to figure out a solution but nothing has really presented
I have been trying to find newly added entities on a context by using

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.