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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:25:16+00:00 2026-06-10T05:25:16+00:00

I am implementing the checkbox with listview for every Iten of listview.The Problem i

  • 0

I am implementing the checkbox with listview for every Iten of listview.The Problem i am getting is when I am clicking on any single check box then some other checkboxes which are not clicked also getting clicked randomly.

public View getView(int position, View convertView, ViewGroup parent) {
            // TODO Auto-generated method stub

            View vi = convertView;
            final int as=position;
            if (convertView == null) { // if it's not recycled, initialize some
                // attributes
                LayoutInflater  inflater = (LayoutInflater) activity
                        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                vi = inflater.inflate(R.layout.grid_item, null);
                holder = new ViewHolder();

                holder.textheader = (TextView) vi.findViewById(R.id.item1);
                holder.textcpu = (TextView) vi.findViewById(R.id.item2);
                holder.text_modified_date = (TextView) vi.findViewById(R.id.item4);
                holder.text_cpu = (TextView) vi.findViewById(R.id.item3);
                holder.text_checkbox=(CheckBox)vi.findViewById(R.id.checkBox1);
                vi.setTag(holder);

                holder.text_checkbox.setOnClickListener(new OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        if (holder.text_checkbox.isClickable()) {
                            itemChecked.set(as, true);
                            packages=as;
                        } else if (!holder.text_checkbox.isClickable()) {
                            itemChecked.set(as, false);
                        }
                        String packag=app_package.get(as);
                        Log.d("package listttttttttt", packag);
                    }
                });


            } else {
                holder = (ViewHolder) vi.getTag();


            }
  • 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-10T05:25:18+00:00Added an answer on June 10, 2026 at 5:25 am

    Try below code

    public View getView(int position, View convertView, ViewGroup parent) {
            // TODO Auto-generated method stub
    
            View vi = convertView;
            final int as=position;
            if (convertView == null) { // if it's not recycled, initialize some
                // attributes
                LayoutInflater  inflater = (LayoutInflater) activity
                        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                vi = inflater.inflate(R.layout.grid_item, null);
                holder = new ViewHolder();
    
                holder.textheader = (TextView) vi.findViewById(R.id.item1);
                holder.textcpu = (TextView) vi.findViewById(R.id.item2);
                holder.text_modified_date = (TextView) vi.findViewById(R.id.item4);
                holder.text_cpu = (TextView) vi.findViewById(R.id.item3);
                holder.text_checkbox=(CheckBox)vi.findViewById(R.id.checkBox1);
                vi.setTag(holder);
    
            } else {
                holder = (ViewHolder) vi.getTag();
            }          
    
    
                 holder.text_checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() 
                 {          
                  public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)      
                    {                                  
                    if(isChecked)
                    {
                          // do your stuff
                          itemChecked.set(as, true);
                            packages=as;
                    }
                    else
                    {
                          // do your stuff
                          itemChecked.set(as, false);
                    }       
    
            }
        });
    
    if(itemChecked.size() != 0 && itemChecked.get(position))
            holder.text_checkbox.setChecked(true);
        else
            holder.text_checkbox.setChecked(false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having custom listview(with image, text and check box) and a button(named Done)
I'm implementing RichFaces checkbox tree, and I've got a problem... I need to mark
I am implementing an HTML form with some checkbox input elements, and I want
I meet are having difficulty in implementing a simple event OnCheckedChanged for control checkBox
Implementing the very first scala example I ran into some problems probably tipical for
I am implementing a checkboxlist with some items and next to each item there
I have a custom template checkbox that I am implementing using a viewbox (using
I have a page on iPad and am facing some issues implementing an equivalent
I'm having a problem while implementing facebook registration tool. I've followed the steps described
I need some help in implementing jQuery. I have a dropdown list with 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.