Reputation: 65
I have 20 checkbox and want to check is all checkbox is checked. I use the below case to check all using OR operator.
if (((CheckBox) v).isChecked()) {
Toast.makeText(MyAndroidAppActivity.this,
"Bro, try Android :)", Toast.LENGTH_LONG).show();
}
But is there any optimized way to check whether all Checkbox is selected
Upvotes: 0
Views: 172
Reputation: 1212
An optimised way :
Alternatively, you could also run a loop with the same code you mentioned as the body.
Upvotes: 1