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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:16:01+00:00 2026-05-27T06:16:01+00:00

I have a checkbox in my ListView row which looks like this. =========================================== [CheckBox]

  • 0

I have a checkbox in my ListView row which looks like this.

===========================================
[CheckBox] [TextView] [TextView] [TextView]
===========================================

the xml code is here

<CheckBox
    android:id="@+id/course_search_checkbox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:clickable="false"
    android:focusable="false" />

And I have already made the checkbox not clickable and focusable so that the click event will be passed to the ListView.

What I want to do here is that when the user click the listview, make the CheckBox checked and add the clicked position of listview to an arraylist. So how can I make the CheckBox checked in an OnItemClickListener of ListView?

Help please, 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-05-27T06:16:02+00:00Added an answer on May 27, 2026 at 6:16 am

    You could add this code within your OnItemClickListener:

    public void onItemClick(AdapterView parent, View view, int position, long id){
       CheckBox box = (CheckBox)view.findViewById(R.id.course_search_checkbox);
       box.setChecked(true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have row for ListView(listview is inside LinearLayout) like <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
I have created listview using layoutinflator. Listview contains checkbox and textview for each row.
In an ASP:ListView control, I have a checkbox for each row. Each row represents
I have a listview with each row having a checkbox, imageview and text view
I have a listview which loads its data from sqlite database. Each row in
I have list view with custom row layout (list_row.xml) that contains CheckBox element: <TableLayout
I have an Android ListView with rows that include one checkbox, and four text
I have this code for an expandable list, I want to have a checkbox
I have ListView with custom Adapter which supplies View to ListView in this way:
I have created one listview, in this each row contain check box and the

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.