Android Question Must initialize radiobuttons?

U

unba1300

Guest
Hi. I have a panel with some radio buttons which is the child of a larger panel and this larger panel is loaded as a panel layout into a scrollview on the main activity layout. But I get a initialization error when first getting to the code to make the radiobutton checked or not. I didn't think we had to initialize things that were part of a layout?
This is in Activity_Create:
B4X:
Activity.LoadLayout("LayoutCats")
scvCats.Panel.LoadLayout("LayoutCatsPanel")
And this is in Activity_Resume:
B4X:
        Select stateFav
            Case 0
                radCatsPanelRadio0.Checked = True
            Case 1
                radCatsPanelRadio1.Checked = True
            Case 2
                radCatsPanelRadio2.Checked = True
            Case 3
                radCatsPanelRadio3.Checked = True
End Select
 
Last edited by a moderator:

stevel05

Expert
Licensed User
Longtime User
If they are in loaded layout you don't need to initialize them. Are they Dimmed in Sub Globals with the same name as they have in the designer?
 
Upvote 0
U

unba1300

Guest
Silly me. That was the problem - I dimmed them with different names. Thank you.
 
Upvote 0
Top