Forums Register Login

radio button in radiogroup

+Pie Number of slices to send: Send
Hello all,
I am presently encountering a problem with my radio buttons that i have created in my program. The selection of the radio buttons is not unique. If i select one radio button and goes to select another one, the previous one is not unchecked. Its selection is not removed. So i can end with all radio buttons in radiogroup being selected. Can anyone tell me where i am doing it wrong?

the radiogroup as defined in my layout xml file


and the code that creates the radio buttons in my activity class file is as follows:


Help, please!
Kind regards



+Pie Number of slices to send: Send
Once i have did something exactly same as your task.
If i find the code i'll post here but so far i remember i made something like following code

+Pie Number of slices to send: Send
Ibrahim,
I thank you for your quick reply. If i understand your code well. It is supposed to uncheck all the other radio butttons on selection of one in the radiogroup. I thought the radiogroup works in a way such that only one radio button can be checked in the group. I have tried your code as follows but all radio buttons can still be checked.


Any clue?
Kind regards




+Pie Number of slices to send: Send
Problem solved. Thanks everybody.
+Pie Number of slices to send: Send
 

Paul Ngom wrote:Problem solved. Thanks everybody.



Dear Paul
Glad to hear your problem solved. If you don't mind could you please post your solution
so, it could be reference for someone else who will have same problem.

Regards
+Pie Number of slices to send: Send
I changed the code to look as follows:

So i was told to change the LinearLayout to RadioGroup.
+Pie Number of slices to send: Send
We need RadioButton, RadioGroup and Event listener to make our radio button work. Radio button is present inside radio group.
How to add it?

How to access radio buttons in android?

How to handle click event?
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1245 times.
Similar Threads
how to add a scrollbar to a view
retrive radio button value in commandline
Activity content overlapping TabView
align radio button
how to align radio button groups
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 23:29:30.