Worksheet 1.5 MAD
Worksheet 1.5 MAD
Experiment 5
if(ch.isChecked())
msg = msg + " Painting ";
if(ch1.isChecked()) msg =
msg + " Reading ";
if(ch2.isChecked()) msg =
msg + " Singing ";
if(ch3.isChecked()) msg =
msg + " Cooking ";
Steps:
2. Name your project and select your language and minimum SDK
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
4. You can start building your application by just dragging and dropping the checkboxes
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
5. Now, go to each checkbox and give it a unique Id and a text corresponding to it.
6. Then edit your MainActivity.java in that you have to get the id of checkbox and then edit the code to
check if the checkbox is checked using the if else statements. Don’t forget to add this Check function to
your button (onClick).
8. Check the boxes and selected its will be displayed in the toast at the bottom of the screen.