Android Radiogroup/radiobutton

Source: Internet
Author: User

A collection of Radiogroup radiobutton that provides a mechanism attribute for multiple selection:  android:orientation="Horizontal/vertical"Vertical vertical arrangement Horizontal horizontal arrangement determines what form RadioButton in the current RadiogroupPrivate Radiogroup RG ;        @Override        protected void onCreate (Bundle savedinstancestate) {               Super. OnCreate (savedinstancestate);               RG= (radiogroup) Findviewbyid (r.id. RadioGroup1);               //implementation of Radiogroup monitoring events               RG. Setoncheckedchangelistener ( New Oncheckedchangelistener () {                      @Override                      Public void oncheckedchanged (radiogroup Group, int Checkedid) {                            // TODO auto-generated Method Stub                            Switch (checkedid) {                            Case r.id.Radio :System. out. println ();                                   Break;                            Case r.id.Radio0 :System. out. println ();                                   Break;                            Case r.id.Radio1 :System. out. println ();                                   Break;                            default:                                   Break;                            }                     }              });       } <Radiogroup        Android:id="@+id/radiogroup1"        Android:layout_width="Match_parent"        Android:layout_height="Wrap_content"        android:orientation="Horizontal"         >         <RadioButton            Android:id="@+id/radio0"            Android:layout_width="Wrap_content"            Android:layout_height="Wrap_content"            android:checked="true"            Android:text="0" />         <RadioButton            Android:id="@+id/radio1"            Android:layout_width="Wrap_content"            Android:layout_height="Wrap_content"            Android:text="1" />    </Radiogroup >

Android Radiogroup/radiobutton

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.