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

  • Home
  • SEARCH
  • 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 6786089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:12:15+00:00 2026-05-26T17:12:15+00:00

I am developing an application which uses list view with check-boxes,consider there are 10

  • 0

I am developing an application which uses list view with check-boxes,consider there are 10 items on list-view items,And by default in that check boxes are checked,Until now every thing is working fine for me here is my problem,When I uncheck any check-box in list-view whole list-view need to be refresh.

  • 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-26T17:12:15+00:00Added an answer on May 26, 2026 at 5:12 pm

    Nikhil just keep in mind that defining a custom adapter is one time practice, once you define and understand it properly then you can customize any views like ListView, GridView, Gallery, Spinner. So go through the below answer properly.

    For defining ListView with CheckBox (or any View), you have to define your own custom adapter. For defining custom adapter, follow below steps:

    1. Define a custom row file (which represents every items of your listview)
    2. Define a adapter class and extends BaseAdapter.
    3. Inflate the above row xml file inside the getView() method of this adapter class.

    In your case,

    1st step: (Define row xml file)

    <RelativeLayout>
       <TextView>
       <CheckBox>
    </RelativeLayout>
    

    2nd & 3rd step: (Define custom adapter class)

    public class MyListViewAdapter extends BaseAdapter
    {
      ....
      ....
    
    
       static class ViewHolder {
            protected TextView text;
            protected CheckBox checkbox;
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View view = null;
            if (convertView == null) {
                LayoutInflater inflator = context.getLayoutInflater();
                view = inflator.inflate(R.layout.rowbuttonlayout, null);
                final ViewHolder viewHolder = new ViewHolder();
                viewHolder.text = (TextView) view.findViewById(R.id.label);
                viewHolder.checkbox = (CheckBox) view.findViewById(R.id.check);
                viewHolder.checkbox
                        .setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    
                            @Override
                            public void onCheckedChanged(CompoundButton buttonView,
                                    boolean isChecked) {
                                Model element = (Model) viewHolder.checkbox
                                        .getTag();
                                element.setSelected(buttonView.isChecked());
    
                            }
                        });
                view.setTag(viewHolder);
                viewHolder.checkbox.setTag(list.get(position));
            } else {
                view = convertView;
                ((ViewHolder) view.getTag()).checkbox.setTag(list.get(position));
            }
            ViewHolder holder = (ViewHolder) view.getTag();
            holder.text.setText(list.get(position).getName());
            holder.checkbox.setChecked(list.get(position).isSelected());
    
    
    .......
    .......
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a PHP application which uses Twig (but that's unimportant) as the view
I am developing grails application which uses file searching.For that I wrote the following
I'm currently developing an asp.net mvc 2 application which uses the default SqlMembershipProvider for
I have heard that when developing application which uses a database you should do
I am developing a small business application which uses Sqlserver 2005 database. Platform: .Net
I've recently started developing my first serious application which uses a SQL database, and
I'm developing an application on GlassFish v3 which uses Suns-RI of JavaEE6 and JSF2.0,
I am developing an application which uses Bluetooth to connect to a device and
I'm developing an application which uses different components to create an XHTML document, I
I am developing a GWT application which uses the standart GWT TabLayoutPanel. Just realized

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.