Search code examples
androidlistviewandroid-listviewlistviewitem

How do I get the status of the check boxes (checked / unchecked) from this listview?


How do I get the status of the check boxes (checked / unchecked) from this listview after the list has loaded?

I know how to check when the list is loading by overriding the getview method of the adapter, but this is not the case.

What I need is to get the status after the list has loaded and the user checks / uncheckes items in the list and hits the backup or delete button from menu.

enter image description here

Thank you.


Solution

  • Your question is way too vague.. Only thing I can answer with the amount of info you gave is to put that in your adapter:

    chkBox = (CheckBox) findViewById(R.id.chkBox);
    
        chkIos.setOnClickListener(new OnClickListener() {
    
          @Override
          public void onClick(View v) {
                    //is chkBox checked?
            if (((CheckBox) v).isChecked()) {
                Toast.makeText(MyAndroidAppActivity.this,
                   "result:", Toast.LENGTH_LONG).show();
            }
    
          }
        });