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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:54:22+00:00 2026-05-19T05:54:22+00:00

friends, i am using following custom adapter to show textview and checboxes in listview.

  • 0

friends,

i am using following custom adapter to show textview and checboxes in listview.
now if textview is selectAll on clicking checbox infront of it in list i should select all checkboxes below in list.
in my case selectall checkbox will be at position “0” and other below it.

any one guide me how to get all checkboxes array so that i could select or deselect them.
any help would be appreciated.

public  class EfficientAdapter extends BaseAdapter implements
        Filterable {
    private LayoutInflater mInflater;
    //private Context context;
    List<DalCategories> obj;

    public EfficientAdapter(Context context,List<DalCategories> value) {

        mInflater = LayoutInflater.from(context);
        obj = value;
        //this.context = context;
    }

    public View getView(final int position, View convertView,
         final  ViewGroup parent) {
        ViewHolder holder;

        convertView = mInflater.inflate(R.layout.list_category_item, null);

        holder = new ViewHolder();
        holder.TextTitle = (TextView) convertView.findViewById(R.id.list_item_title);
        holder.checkBoxes = (CheckBox) convertView.findViewById(R.id.chkSubCategory);


        if(obj.get(position).isIs_Selected())
        {
            holder.checkBoxes.setChecked(true);
        }


        holder.checkBoxes
        .setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(
                    CompoundButton buttonView, boolean isChecked) {

                if(select_all == true)
{               
                // select all here........


}                   


            }
        });

        convertView.setTag(holder);


        holder.TextTitle.setText(obj.get(position).getTitle());



        return convertView;
    }

     class ViewHolder 
     {
        public TextView TextTitle;
        public CheckBox checkBoxes;
     }

    @Override
    public Filter getFilter() {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public int getCount() {
        return obj.size();
    }

    @Override
    public Object getItem(int position) {
        return obj.get(position);
    }

    }`enter code here`
  • 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-19T05:54:23+00:00Added an answer on May 19, 2026 at 5:54 am

    To answer your main question… what you should do is iterate over the stored data (List obj) and set the values to true, and then call notifyDataSetChanged().

    However there are many problems with your (somewhat ironically named) EfficientAdapter that you should address.

    Firstly, you are using the ViewHolder pattern, but that’s completely useless here because you’re ignoring the convertView argument and creating a new view from scratch every time. Since your views never get reused, the viewholder doesn’t do anything for you. You should only inflate a new view if convertView is null.

    Secondly, it seems like you only have an action on click when the first item is clicked, but you’re creating and setting handlers on every item. You could make your code more efficient by just moving that check outside rather than attaching an effectively no-op event handler to all but one of your elements.

    I strongly suggest you go this video on ListViews from google I/O: http://developer.android.com/videos/index.html#

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

Sidebar

Related Questions

friends, i am using following tutorial to lazy load list view now problem is
friends, i am using following code to display list with radio buttons now i
friends, i have created custom title bar using following titlebar.xml file with code <?xml
Using the following code to display a list of friends from my twitter profile.
I'm using the following code to retrieve the user's friends list and the info
Hi I am using following FQL to fetch friends list from facebook and their
friends, right now i am showing list of map overlays on google map using
Friends, I'm populating a GridView in my asp.net application using following code. GridView grdExport
Now I'm following one more friend and now I started to learn PLT Scheme(using
I'm trying to get a list of user's friends using fb connect for 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.