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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:44:26+00:00 2026-06-03T00:44:26+00:00

I have a problem with setting the click event in a list view item.

  • 0

I have a problem with setting the click event in a list view item.

This is how the list is shown in the default situation:

enter image description here

This is how it looks when I press the red image (the red turns to blue):
enter image description here

and this is when I press the list item:
enter image description here

As you can see, the red image turns to blue also, Even though I didn’t pressed the button. What I want is that when I press the list item there is no change to the red image, and it remains the same.

I tried to add android:drawSelectorOnTop="true" to xml file in listview section, but it didn’t work. I also tried to fix it with the selector parameters, still with no success.

I uploaded some code, the next sections are in different xml files, so don’t get confused.

EDIT: I want to use the OS item list background color and not my own color with android:listSelector, because that one I’ve already do.

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true" android:drawable="@color/blue" />
    <item android:drawable="@color/red"/> 

</selector>

———————–new file——————————–

<ListView android:id="@+id/list_theme"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_above="@id/contbtn_themelist"
    android:stackFromBottom="false"
    android:transcriptMode="disabled"/>

———————–new file——————————–

<RelativeLayout android:id="@+id/edit_back"
    android:layout_width="80dp"
    android:layout_height="77dp"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentBottom="true"
    android:background="@drawable/edit_skin_selector2"  >

    <ImageView
        android:id="@+id/skinEdit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:scaleType="fitXY"
        android:src="@android:drawable/ic_menu_edit"
        android:layout_centerInParent="true" />
</RelativeLayout>

EDIT: row.xml

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:paddingBottom="5dip"
        android:paddingLeft="2dip"
        android:paddingRight="2dip"
        android:paddingTop="5dip" >

        <ImageView
            android:id="@+id/itemlist_checkedd"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:adjustViewBounds="true"
            android:src="@drawable/ic_checkitem" />

        <ImageView
            android:id="@+id/skinpreview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toRightOf="@id/itemlist_checkedd"
            android:scaleType="fitXY" />

        <RelativeLayout android:id="@+id/edit_back"
            android:layout_width="60dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:background="@drawable/edit_skin_selector2"
            android:layout_centerVertical="true"
            android:layout_centerHorizontal="true">

            <ImageView 
                android:id="@+id/skinEdit"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@android:drawable/ic_menu_edit"
                android:layout_centerInParent="true" />
        </RelativeLayout>

        <ImageView
            android:id="@+id/separator"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginRight="5dip"
            android:layout_toLeftOf="@id/edit_back"
            android:src="@drawable/separator" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="2dip"
            android:layout_marginRight="15dip"
            android:layout_toLeftOf="@id/separator"
            android:layout_toRightOf="@id/skinpreview"
            android:textAppearance="?android:attr/textAppearanceLarge" />

 </RelativeLayout>

Any help will be great, Thanks.

  • 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-03T00:44:27+00:00Added an answer on June 3, 2026 at 12:44 am

    I encountered this issue too, I solved it using the tecnique here:

    http://android.cyrilmottier.com/?p=525

    Look at the paragraph “Don’t press everything!”

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

Sidebar

Related Questions

I have this weird problem with setting up cookies with PHP. Everything worked fine
I have a dropdown box that I am setting another event to. This is
I have problem with setting proper charset on my jsf pages. I use MySql
I have a problem with setting the TTL on my Datagram packets. I am
I have a problem with setting Browsing Path in Delphi 2009: When I install
i have problem to correctly bind data to WPF Chart. When i'm setting ItemsSource
I have a weird problem where after setting nocheck on a foreign constraint and
Weired problem! ASP.NET Session expires instantly. In my web.config I have this session settings:
I have a custom list view and I want the background of the list
I have this problem in a bigger Project...... so I set up a 'Testpoject'

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.