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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:15:02+00:00 2026-05-28T03:15:02+00:00

I have a ListView with a custom adapter. It countains CheckBoxes. When one of

  • 0

I have a ListView with a custom adapter. It countains CheckBoxes. When one of them is checked, I would like to have the others unchecked. I tried creating a CheckBox list, and then created a method to return this list, but it kept giving IndexOutOfBounds (I added the CheckBoxes to the list at the getView method).

This is my adapter.

The xml:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

<CheckBox android:id="@+id/checkBoxListView"
    android:layout_height="50px"
    android:layout_width="50px"/>

<EditText android:id="@+id/editTxtListView"
    android:layout_height="50px"
    android:layout_width="680px"
    android:editable="false"
    android:focusable="false" />    

  • 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-28T03:15:03+00:00Added an answer on May 28, 2026 at 3:15 am

    why not have a global integer representing the checked position and in the getview method see if the global variable’s value and the position, for which getView is called, are same then make check box checked else unchecked.

    Saw your code in the pastebin.
    You are making it quite a complex thing.
    Anyway, just a quick comment,
    Dont do this.pos=position;
    in the getView().

    Instead of this check if(postion==this.pos){
    //Check this checkbox}
    else{
    //uncheck this check box
    }

    Also, “pos” should be controlled by the activity or the pojo itself handling the data for the list.

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

Sidebar

Related Questions

I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter
I have two ItemsControls, one a ListView, and one a custom control I am
We have created custom listview by using the Base adapter. List view contains Text
I have a ListView with a custom view rendered by an adapter. It contains
I have a listview with custom array adapter, the view allows the user to
I have one custom ListView called AreasListView which I've included in the XML file.
I have a ListView powered by a custom adapter that dynamically changes the background
I have a custom listView. The main layout xml is something like this: <?xml
I currently have a ListView with a custom adapter that gets information describing the
I have a listview with a custom array adapter: public class SmsMessageAdapter extends ArrayAdapter<ContactMessage>

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.