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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:20:38+00:00 2026-06-05T03:20:38+00:00

i would like to implement, while i select list view that time my check

  • 0

i would like to implement, while i select list view that time my check box will be selected.
enter image description here

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

    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.list_row, null);

        holder = new ViewHolder();
        holder.checkbox = (CheckBox) convertView.findViewById(R.id.mycheckbox);
        holder.text = (TextView) convertView.findViewById(R.id.mytext);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    MyList mylist = mItems.get(position);

holder.text.setText(mylist.getMyText());


    holder.checkbox.setChecked(mChecked.get(position));
holder.chkItem.setChecked(mChecked.get(position));
    holder.chkItem.setOnCheckedChangeListener(new OnCheckedChangeListener()
     {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // TODO Auto-generated method stub
            mChecked.set((Integer) buttonView.getTag(),isChecked);

        }
     });

    return convertView;
}

static class ViewHolder {
    CheckBox checkbox;
    TextView text;
}
}

here the check box item only selected, but i want if i click list view, check box will be selected, any one cane help me? why i am asking the same question again mean i tried list view click event through item click listener, but its not working i tried setFocusable(true) also, but not working.

  • 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-05T03:20:42+00:00Added an answer on June 5, 2026 at 3:20 am

    Here my answer,

    convertView .setOnClickListener(new OnClickListener() {         
    
            public void onClick(View v) {
                // TODO Below is hardcoded to get item at index 1
                // This needs to be changed to fool-proof
                CheckBox checkBox = ((CheckBox)v.getTouchables().get(1));
                checkBox.setChecked(! checkBox.isChecked()); 
    
                System.out.println("Listview clicked");
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to implement MVC while using LINQ (specifically, LINQ-to-entities). The way I would
We would like to implement a web form that automatically saves content at regular
I would like to implement some Drag-select functionality into a project of mine but
I would like to implement a view similar to the detail view of Apple's
i would like to implement 'drawing modes' (in my own graphics library). That is
I like to implement linked list in c++ ,while adding new node I dynamically
I'm developing a notepad clone. I would like to implement a block select as
I would like to implement something similar to 37Signals's Yellow Fade effect. I am
I would like to implement a map simmilar to this: http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/examples/advanced_example.html One of the
I would like to implement a parallel version of the code below using threads

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.