Reputation: 11608
Assuming some logic that deals with measure units and the user is asked to choose between US and metric systems, what would be the better UI choice: using 2 CheckBoxes
or RadioButtons
? Is there an easy way to ensure just one View
is checked?
Upvotes: 1
Views: 1675
Reputation: 14237
Checkboxes are useful when you want the user to select multiple options.
Radio buttons are useful to guarantee a single option among multiple options. However, if you have a fair amount of radio buttons the user interface becomes a mess. Therefore, for those cases, Spinners are the best answer for your problem.
If you use Radio Buttons you can guarantee they only use one radio button using RadioGroups.
Upvotes: 1
Reputation: 1042
Simple. If you can't follow some of procedures I suggest going and look for tuts on them First: Go to your xml file Second: Create Radio group Third: Create Radio button in between Forth: make sure you have the id of the radio button. fifth: call the item on your main class. RadioButton name = (RadioButton)findViewById(R.id.radioButton Name);
Now you can program the rest everything really just follows this order for anything in .xml. You need it call it and create and ID simple. Next time just look at youtube vids. I recommend the website TheNewBoston.org best tuts you'll ever encounter in a life time for almost all programming languages.
Upvotes: 0
Reputation: 1544
Through radio button group you can do it. Just use a RadiobuttonGroup widget mention your radiobutton properties.
Upvotes: 0
Reputation: 30825
I would use a Spinner if I were you. It'll allow you to add other unit systems in the future.
Upvotes: 0