Android Studio Fourth time job

Source: Internet
Author: User

Display effect:

Java code

Gendergroup.setoncheckedchangelistener (New Radiogroup.oncheckedchangelistener () {
public void OnCheckedChanged (Radiogroup group,int chackedid) {
if (femalbutton.getid () = = Chackedid) {
System.out.println ("female");
Toast.maketext (Activity9.this, "Famle", Toast.length_short). Show ();
}
else if (malebutton.getid () = = Chackedid) {
System.out.println ("male");
}
}
});
This monitoring is used to show men and women, of whom men and women are selected only in one of them, can not choose two
Swimbox.setoncheckedchangelistener (New Compoundbutton.oncheckedchangelistener () {
public void OnCheckedChanged (Compoundbutton buttonview,boolean isChecked) {
if (isChecked) {

System.out.println ("Swim is checked");
}
else {
System.out.println ("Swim is unchecked");
}
}

});
Runbox.setoncheckedchangelistener (New Compoundbutton.oncheckedchangelistener () {
public void OnCheckedChanged (Compoundbutton buttonview,boolean isChecked) {
if (isChecked) {
System.out.println ("Run is checked");
}
else{
System.out.println ("Run is unchecked");
}
}

});
Readbox.setoncheckedchangelistener (New Compoundbutton.oncheckedchangelistener () {
public void OnCheckedChanged (Compoundbutton buttonview,boolean isChecked) {
if (isChecked) {
System.out.println ("read is checked");
}
else{
System.out.println ("read is unchecked");
}
}
});
These three judgments are used to determine which one you choose! These three can be multi-choice, when you choose any of them will print a sentence as a result

Android Studio Fourth time job

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.