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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:29:51+00:00 2026-05-23T00:29:51+00:00

How can i save the info from a multiple choice listview into the database?

  • 0

How can i save the info from a multiple choice listview into the database? I want to save the status of a item from a list. For instance, if i have 2 items checked i want to save this status in the database.

Thanks

  • 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-23T00:29:52+00:00Added an answer on May 23, 2026 at 12:29 am

    Sure fegol,

    I assume you already set up the multiple choice listview. (if not, please check online there are heaps of them http://www.androidpeople.com/android-listview-multiple-choice-example).

    Here I’d like to give you some hint on data-saving problem.

    Basically, there are two common choices. The first is to use getCheckedItemIds() or getCheckedItemPositions() on your listview (http://developer.android.com/reference/android/widget/AbsListView.html#getCheckedItemIds()).

    The second one which is more flexible is to write a custom adapter. You can use isChecked() to check whether the checkbox was checked, and then save the status into your hashmap. Then you can get all status of checkboxes at the last.

    I put some pseudo-code for the second approach for you. Hope this helps.

        ArrayList<Boolean> checkList = new ArrayList<Boolean>();
        // TODO: put some empty data into checkList  
    
    
    
        private OnItemClickListener myListItemClickListener = new ListView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> arg0, View v, int position, long id) {
    
    
            if(checkList.get(position)){
                checkList.set(position, false);
            }else{
                checkList.set(position, true);
            }
    
            ((mAdapter)mList.getAdapter()).notifyDataSetChanged();
    
            }
        }
    
    
    
        class mAdapter extends BaseAdapter{
    
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
    
                if (checkList.get(position)){
                    checkBox.setChecked(true);
                }else{
                    checkBox.setChecked(false);
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If all tables I want to delete from have the column gamer_id can i
Can I save page pictures from GreaseMonkey script directly to my hard drive? Is
how can I save a java applet from a website so I can run
I have a database (MySql) and need to store some results from a web
I have a site where users can save images together with a couple of
I discovered that the existence and use of metaclasses can save you from a
In my database, I have the following entry id | name | info 1
You can save a SQL Server 2000 DTS package as a VB .BAS file.
Internet Explorer can save its content as an MHTML file using the Save As...
Are there any Java VMs which can save their state to a file and

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.