13.03.2011 18:14, Aisthesis пишет:
to drop the RadioGroup but keep the
RadioButtons and manage their states by setting an
onCheckedChangeListener?
You will need something that "implements OnCheckedChangeListener", might
as well be your activity.
Also something to store the currently selected radio button (e.g.
"private CompoundButton mCurrentButton").
Then in onCreate, find all the radio buttons, and call
button.setOnCheckedChangeListener for each.
Finally, in the "thing" that "implements OnCheckedChangeListener",
something like this:
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked && mCurrentButton != button) {
mCurrentButton .setChecked(false);
mCurrentButton = button;
}
}
With the above you don't need a RadioGroup, and the currently selected
option is always in "mCurrentButton".
-- Kostya
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en