0
Hello, I’m creating a Checklist app, but Checklist has over 30 items and I’m using "Switch". When the user fills everything she will send to a database where someone else will see the items that are "checked", but wanted to know a way to check all Switchs without having to check one by one for example:
"Long Date" is the month the check list was made
item = findViewById(R.id.checklist_item1);
FirebaseDatabase.getInstance().getReference("CheckList").child(extensoData.toString()).setValue(item.isChecked()).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
Toast.makeText(CheckListsem.this, "CheckList feita.", Toast.LENGTH_SHORT).show();
}
});
How’s the hierarchy of your database?
– Murillo Comino
```Checklistid -> Vehicle-> Date -> item1 = "true"```` Obs; "Vehicle" would be the name of the Checklist the person is making, for example; it has 2 types of Checklist "Tractor" and "Kombi".
– Choice
I couldn’t see very well yet, but couldn’t you save all checked items instead of a Boolean for each, but save as an array of strings? So you recover at once all that had been checked.
– Murillo Comino