0

I am currently doing a project on android programming for a university project and i have to make a quiz. The answers are in radiobuttons and i was wondering if it is possible to randomize the position of radiobuttons in a radiogroup. We are currently using android studio 3.5

MikeP
  • 1

1 Answers1

0

You certainly can. Declare them programmatically rather than in XML.

Look at this answer for inspiration: Creating RadioGroup programmatically

Cory Roy
  • 5,379
  • 2
  • 28
  • 47
  • Is there a way to do it creating the radiobuttons and radiogroups in XML? – MikeP Nov 08 '19 at 17:46
  • Perhaps you could define them in XML, then parse them, reorder them and put overwrite the radio group via code. There would be no way to do this with XML alone. – Cory Roy Nov 10 '19 at 17:18