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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:35:44+00:00 2026-05-31T10:35:44+00:00

I created a listview with an image and some text with following layout and

  • 0

I created a listview with an image and some text with following layout and it worked. Whenever I clicked the Text “onListItemClick” was called successfully:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:id="@+id/image"
android:layout_width="40dip" 
android:layout_height="40dip"
android:src="@drawable/icon"/>

<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</LinearLayout>

Then I added a checkbox between the text and the image and I could no longer get the clicks when I click on the text and also not when I click the checkboxes:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:id="@+id/image"
android:layout_width="40dip" 
android:layout_height="40dip"
android:src="@drawable/icon"/>

<CheckBox
android:id="@+id/check"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>

<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</LinearLayout>

Is there a way so that I can get clicks on the checkboxes and the text ?

  • 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-31T10:35:45+00:00Added an answer on May 31, 2026 at 10:35 am

    The checkbox is probably stealing focus.

    Try setting android:focusable="false" on the checkbox.

    A side note:
    Please note that there is a way to handle checkbox selects in lists where the framework takes care of most of the job. Set CHOICE_MODE_MULTIPLE on the list and use a layout that has for example a CheckedTextView. You can get ids using getCheckedItemIds(). See for example android.R.layout.simple_list_item_multiple_choice . There are implementations in the api demos.
    Don’t try this on expandable list view though, since that won’t handle the click ids correctly.

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

Sidebar

Related Questions

I have a ListView than contains a list of image created from web link
I recently created a ListView using ListAdapter and applied a static background image behind
I've created a custom ListView by extending SimpleCursorAdapter. The result is IMAGE + CheckedTextView
I've created a custom ListView by extending SimpleCursorAdapter. The result is IMAGE + CheckedTextView
I'm gonna create a ListView in WPF like the below image (source: picfront.org )
I've created a ListView with a GridView component in it. Now trying to fill
I have created a UserControl that has a ListView in it. The ListView is
I have a listview with several items that are created dynamically, each has two
I have created a specific List which exists out of the following elements to
Android:How to display images from the web in a ListView?I have the following code

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.