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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:27:51+00:00 2026-05-18T08:27:51+00:00

When the user presses a ListView item (android:state_pressed=true) it flashes a shade of yellow

  • 0

When the user presses a ListView item (android:state_pressed=”true”) it flashes a shade of yellow (or you can press and hold).

What drawable is this? I’ve created my own selector because I want my own ListView item color , but I lose the pressed color.

There’s an Android doc about skinning buttons that references #ffff0000, but this produces red.

Does anyone know what it is and how to reference it?

  • 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-18T08:27:51+00:00Added an answer on May 18, 2026 at 8:27 am

    The default system resources can be found in <android-sdk>/platforms/android-<version>/data/res. In particular, the list selector is defined in drawable/list_selector_background.xml:

    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    
        <item android:state_window_focused="false"
            android:drawable="@color/transparent" />
    
        <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
        <item android:state_focused="true" android:state_enabled="false"
            android:state_pressed="true"
            android:drawable="@drawable/list_selector_background_disabled" />
        <item android:state_focused="true" android:state_enabled="false"
            android:drawable="@drawable/list_selector_background_disabled" />
    
        <item android:state_focused="true" android:state_pressed="true"
            android:drawable="@drawable/list_selector_background_transition" />
        <item android:state_focused="false" android:state_pressed="true"
            android:drawable="@drawable/list_selector_background_transition" />
    
        <item android:state_focused="true"
            android:drawable="@drawable/list_selector_background_focus" />
    
    </selector>
    

    The drawable that is shown on a press, list_selector_background_transition, is not a single color but two 9-patch images, a yellow and a white one, with an animated transition between them.

    <transition xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:drawable="@android:drawable/list_selector_background_pressed"  />
        <item android:drawable="@android:drawable/list_selector_background_longpress"  />
    </transition>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView that will allow the user to long-press an item to
When the user presses the X in the Main Window, I have this dialog
I want to change the background of a listview item when the user clicks
I have an Activity with the ListView with text items inside. When user presses
I have a listview that displays files from a directory. The user can drag
I have a textbox inside a listview in which user can edit it, itemsource
I'm working with a listview and a context menu. When the user long presses
I have a SimpleAdapter that populates a ListView, but when the user presses an
I have a listview and when the user presses a button I want to
I was just testing this, and if the user presses the temporary loading... row

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.