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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:56:34+00:00 2026-05-31T19:56:34+00:00

I have created a custom list view, each row has it’s own custom selector,

  • 0

I have created a custom list view, each row has it’s own custom selector, contains various misc. elements and 1 Relative layout with it’s own selector. (I’m using relative layout since an Image Button won’t suffice in functionality for me).

The list elements have different states, in some the whole item is clickable and the button, and in others the item shouldn’t be clickable, only the relative layout(further referenced as button for simplicity).

After a lot of fiddling, I decided to solve this by setting a static background (the normal state drawable from the selector) for the non-clickable rows and the selector itself for the clickable ones. (If you have a better solution for this please feel free to correct me, it is not the point of the question but i welcome any help)

The problem is, that even though the row itself doesn’t change background, the selector for the button is triggered. I tested it and the same happens when the row has the selector as it’s background.

My question is why does the list item click trigger both selectors, when I am clearly clicking on the item only, when I click the button, the row selector is not triggered.

Also I should mention that in my row layout, the button is above the item selector(or is contained by 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-31T19:56:35+00:00Added an answer on May 31, 2026 at 7:56 pm

    So I couldn’t find a proper solution for this, and I went around it a bit.

    What seems to be happening is that, the onItemClick event triggers all selectors, in the custom layout, which is rather inconvinient so I skipped it, and Implemented on onClickListener on each of my views, to save the position of the element that was clicked, I set to one of my views in each element the respective position in the array as a tag. Next time i just further the click even to a custom method in the respective activity ( I mage a single adapter for 5 activities) I just check with an activity parameter which instance we are in, cast the activity variable, and call the method. If you know any better solutions please feel free to tell me.

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

Sidebar

Related Questions

I have created a custom listview using adapter. Each row of the list view
I have created a custom list view . In each listitem i have a
I created a ListView with a custom layout for each view. I have several
I currently have a custom listview where each item on the list contains two
I have created a custom adapter to display different images in the each list
I have created a custom listview that is populated using a row.xml file. Each
I have created custom listview, each row looks like my file custom_row.xml. Is there
I have created a custom list as a feature in sharepoint. i need to
I have a ListView than contains a list of image created from web link
For example if i have to create custom list view about type of food,

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.