Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
AddStatelistRadioButton(rbtTest1, "Flag_GB_1.png", "Flag_GB_2.png", "Flag_GB_3.png", Gravity.CENTER)
AddStatelistRadioButton(rbtTest2, "Flag_F_1.png", "Flag_F_2.png", "Flag_F_3.png", Gravity.CENTER)
End Sub
Sub AddStatelistRadioButton(rbt As RadioButton, ImageEnabled As String, ImageChecked As String, ImagePressed As String, mGravity As Int)
Dim sdw As StateListDrawable
sdw.Initialize
Dim bdwEnabled, bdwChecked, bdwPressed As BitmapDrawable
bdwEnabled.Initialize(LoadBitmap(File.DirAssets, ImageEnabled))
bdwEnabled.Gravity = mGravity
bdwChecked.Initialize(LoadBitmap(File.DirAssets, ImageChecked))
bdwChecked.Gravity = mGravity
bdwPressed.Initialize(LoadBitmap(File.DirAssets, ImagePressed))
bdwPressed.Gravity = mGravity
sdw.AddState(sdw.State_Checked, bdwChecked)
sdw.AddState(sdw.State_Pressed, bdwPressed)
sdw.AddCatchAllState(bdwEnabled)
rbt.Background = sdw
End Sub