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

  • Home
  • SEARCH
  • 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 9218149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:47:47+00:00 2026-06-18T02:47:47+00:00

In my android application i have list view and detail view for each list

  • 0

In my android application i have list view and detail view for each list item. For tablets i have shown list view of items and selected item’s detail view as follows.

enter image description here

So my problem is how can i highlight the selected item after user clicks on list item.

I am using a BaseAdapter to load list view.How can i do this any idea??

EDIT:

Yes as chintan khetiya mentioned i have used following xml file as the background of list item but it will not delighted the selected item. What have i missed?

    <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item 
 android:state_selected="false"
    android:state_pressed="false" 
    android:drawable="@color/abs__background_holo_light" />
<item android:state_pressed="true" 
    android:drawable="@color/action_bar_blue" />
<item android:state_selected="true"
 android:state_pressed="false" 
    android:drawable="@color/action_bar_blue" />
</selector>
  • 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-06-18T02:47:48+00:00Added an answer on June 18, 2026 at 2:47 am

    Your Query :

    my problem is how can i highlight the selected item after user clicks on list item.

    I think you are asking about selector. Mean if the list row in focus state then it should be look different form all other row. Same thing when you press or Touch the Row.

    For that you have to make Selector.xml File in Drawable folder and just put that selector file in your list row

    That file should have different tag like Focus-Click-Press and change the Drawable as per state.

    Update :

    Just Replace Your icon and save in Drawable folder.

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    
        <!-- Pressed -->
        <item android:drawable="@drawable/p_paly_press" android:state_pressed="true"/>
    
        <!-- selected -->
        <item android:drawable="@drawable/p_play" android:state_selected="true"/>
    
        <!-- focused -->
        <item android:drawable="@drawable/p_paly_press" android:state_focused="true"/>
    
        <!-- default -->
        <item android:drawable="@drawable/p_play"/>
    
    </selector>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing an contact list android application but i have a small problem
I am doing an contact list android application but i have a small problem
I have a list view in an Android application used to display an ArrayList
In my Android application, I have a simple list view with adapter. There's a
I'm developing an Android application. On one activity I have a List with list
i'm building an android application which have a chat. in this chat i each
I have made a ListView in my android application. But the problem is that
In my android application I have a Spinner . problem is come when I
In an Android application, similar to an application market, I have a Home view
I am testing an application where we have a list view with list of

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.