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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:41:48+00:00 2026-06-09T18:41:48+00:00

I have a ListView with the CheckBox . I want to get the selected

  • 0

I have a ListView with the CheckBox. I want to get the selected items from the ListView like example MyFiles application we selecting the multiple files with CheckBox and clicking the single delete button to delete all the files.

  • 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-09T18:41:50+00:00Added an answer on June 9, 2026 at 6:41 pm
      boolean bulkflag = false;
      ListView reportslistview = (ListView) findViewById(android.R.id.list);
      public class MyAdapter extends SimpleAdapter {
        //private List<Table> tables;
        SharedPreferences prefs;
        private Activity activity;
        String val = "";
    
        //@SuppressWarnings("unchecked")
        public MyAdapter(Activity context, List<? extends Map<String, String>> tables, int resource, String[] from,
                int[] to) {
            super(context, tables, resource, from, to);
            //this.tables = (List<Table>) tables;
            activity    =   context;
        }
    
        public View getView(final int position, final View convertView, ViewGroup parent) {
            View row = super.getView(position, convertView, parent);
            if (row == null) 
            {
                LayoutInflater inflater = (LayoutInflater) activity
                        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                row = inflater.inflate(R.layout.reports_list, null);
            }       
    
            final CheckBox cBox=(CheckBox)row.findViewById(R.id.cb1);
            if(bulkflag)
            {
                cBox.setVisibility(View.VISIBLE);
            }
            else
            {
                cBox.setVisibility(View.GONE);
            }
            cBox.setOnClickListener(new OnClickListener() {
    
                public void onClick(View v) {
    
                    if(cBox.isChecked())
                    {
                        selectedIds.add(recIdArr.get(reportslistview.getPositionForView(cBox)));
                        //System.out.println("position "+reportslistview.getPositionForView(cBox));
                    }
                    else
                    {
                        selectedIds.remove(recIdArr.get(reportslistview.getPositionForView(cBox)));
                    }
                }
            });
            return row;
        }
    }
    

    Checking ====>

     for(int i=0;i<selectedIds.size();i++)
     {
        System.out.println("delete multiple"+selectedIds.size()+" "+Integer.parseInt(selectedIds.get(i)));
     }
    

    Declare selectedIds as a global variable

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

Sidebar

Related Questions

I want to save the state of a multiple choice listview checkbox's. I have
I have listview control.There is an option to remove selected items.After the user removes
I have a ListView with Horizontal WrapPanel as its ItemsPanelTemplate. I want to get
I have a listView with checkbox which populate from sqlite table. I need to
I have a listview with checkbox,now i want to check/uncheck the listitems by clicking
I have a checkbox in my ListView row which looks like this. =========================================== [CheckBox]
I have list view with custom array adapter. I want to get items click
I have the custom Listview. there are two textboxes and a checkbox. Xml files
I have a ListView with a CheckBox as one of the columns, bound to
I have a ListView and each item have a TextView. I would like add

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.