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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:16:13+00:00 2026-05-21T04:16:13+00:00

Okay I know this may sound like any other issues regarding the ListView and

  • 0

Okay I know this may sound like any other issues regarding the ListView and ListActivity issues but this is not, I am going to go crazy as I have in the past week gone on and on searching all post to find any solution to this that may help me. Already tried ListView item background via custom selector and GetView Vs. BindView in a custom CursorAdapter? every other possible blogs sites…

Okay the issue, My listView for one 1 will not allows selection/fire events and 2. will not change the row highlight when an item is clicked. I have a standard TestActivity extending ListActivity and I have implemented a Custom TestCursorAdapter extends SimpleCursorAdapter

Now in XML side of things I have on test_list_view.xml and second one row_view.xml Now I followed the above mentions answers and implement selector as row_selector.xml. But the issue is for one the rows does not accept any click or focus events. I implemented a basic toast to indicate if there is anything happening

@Override
protected void onListItemClick(ListView l, View v , int postion, long idontnow){
    Toast.makeText(getApplicationContext(), "Hello World",  Toast.LENGTH_SHORT ).show();
}

part of test_list_view.xml

<ListView android:id="@android:id/list" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:drawSelectorOnTop="true" 
    android:cacheColorHint="#00000000"
    android:focusable="true" 
    android:listSelector="@color/row_selector" 
    android:background="@color/Transparent"/>

part of selector.xml (basically copied and pasted from one of the above mentioned links)

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" 
        android:drawable="@color/Transparent" />
    <item 
        android:state_focused="true"
        android:state_enabled="false"
        android:state_pressed="true" 
        android:drawable="@color/green" />
    <item 
        android:state_focused="true"
        android:state_enabled="false"      
        android:drawable="@color/green" />
    <item 
        android:state_focused="true"
        android:state_pressed="true" 
        android:drawable="@color/blue" />
    <item 
        android:state_focused="false"
        android:state_pressed="true" 
        android:drawable="@color/blue" />
    <item 
        android:state_focused="true" 
        android:drawable="@color/green" />
    <item 
        android:state_selected="true" 
        android:drawable="@color/blue" />
    <item 
        android:drawable="@color/Transparent" />
</selector>

I followed all options that I am aware of and still nothing. The only major difference is guys I am not using getView instead I am using bindView.

Any help guys will be highly appreciated.

thanks in advance.

Sanj

  • 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-21T04:16:14+00:00Added an answer on May 21, 2026 at 4:16 am

    I suggest that you remove the android:focusable="true" from the ListView.

    Additionally, you can use the selector as the background color of the items that are displayed in the ListView. Also be sure that those elements are not calling onClick or onTouch or something like that, and let the ListView handle the click events.

    I hope this helps

    EDIT:

    for your problem with selecting the item use

    lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                yourMethod();
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I know questions like this exist in multiple forms across StackOverflow and other
Okay, I know this question doesn't show research effort, but I've been going through
Okay, I know this is a Noob question but I cant see to get
Okay, I know that 1) this is probably not possible with CSS alone and
Okay, I know it is weird but when I put this code between <head
Okay, so this is sort of a hack...but it may have to be. I'm
Okay, this may be a silly question but I'm still on my path to
Okay i know this has been a question asked b4, but since it should
Okay I know this is really stupid.But how to i write SELECT Column1 FROM
Okay the question title may not have made sense... mostly because I don't know

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.