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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:34:23+00:00 2026-05-26T01:34:23+00:00

I have created listview using layoutinflator. Listview contains checkbox and textview for each row.

  • 0

I have created listview using layoutinflator. Listview contains checkbox and textview for each row. I am displaying items in a listview with checkbox checked by default.I can check\uncheck these items.

Now on the same layout I have one button and under clickevent of this button I want to check which item has checkbox in checked state and which has not.

Can anybody have any idea how to check this?

My Inflator code is:

public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;

    try {
        mydbadapter.open();
        if (view == null) {
            LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = vi.inflate(R.layout.syncissue_row, null);
        }
        issue = (TextView) view.findViewById(R.id.issuedescription);
        checkbox = (CheckBox) view.findViewById(R.id.issueCheckBox);
        issue.setText(arrlstFaults.get(position));
        checkbox.setChecked(true);
    } catch (SQLException e) {
        mydbadapter.close();
        e.printStackTrace();
    } finally {
        mydbadapter.close();
    }
    return view;
}
  • 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-26T01:34:24+00:00Added an answer on May 26, 2026 at 1:34 am

    My answer is not standard one, but you can go for it if you don’t find any other alternative.
    you can update your getView() method something like bellow.

    public View getView(int position, View convertView, ViewGroup parent) {
        View view = convertView;
    
        try {
            mydbadapter.open();
            if (view == null) {
                LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                view = vi.inflate(R.layout.syncissue_row, null);
            }
            issue = (TextView) view.findViewById(R.id.issuedescription);
            checkbox = (CheckBox) view.findViewById(R.id.issueCheckBox);
            issue.setText(arrlstFaults.get(position));
            // add bellow line
            checkbox.setOnCheckedChangeListener(new MyCheckedChangeListener(position));
            checkbox.setChecked(true);
        } catch (SQLException e) {
            mydbadapter.close();
            e.printStackTrace();
        } finally {
            mydbadapter.close();
        }
        return view;
    }
    

    and you can write listener for having event of check changed. something like bellow. you can maintain one Hashtable for storing the check status as shown bellow.

     Hashtable ht = new Hashtable<Integer, Boolean>();
    
    class MyCheckedChangeListener implements OnCheckedChangeListener
    {
        int position = -1;
        myCheckedChangeListener(int position){
            this.position = position;
        }
    
        @Override
    public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {
    
       ht.put(position, isChecked);
    }
    
    }
    

    I hope It will work for you.

    • 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 several items that are created dynamically, each has two
We have created custom listview by using the Base adapter. List view contains Text
I have a custom listview row that contains a number of textView components. Instead
I created one checkbox and one textfield for each line using wicket listview. When
I have created four tabs with listview in each. I have been attempting to
I have created a dialog that shows a multi-choice list of items that can
I have created four tabs using tabhost, and placed four listviews in each like
I have a list of items, created by a listview. I would like to
I have created a UserControl that has a ListView in it. The ListView is
I have created a list view that displays the names and dates of items

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.