List/meny quistion

volvomann

Active Member
Licensed User
Longtime User
Hallo. I use this code ro select mann / dame in my app: (Mann = default)
My question is if i select dame how can the radiobutten i the list stay i dame next time i open the menylist?

Sub butt4mp_Click
Dim result As Int
Dim myList As List
myList.Initialize
myList.Add("Mann")
myList.Add("Dame")
result = InputList(myList, "Velg mann dame",0)
If result = 0 Then
man= 10
Else If result = 1 Then
man = 20

End If
If man=10 Then
Label7mp.Text= "Mann"
ImageView1.Visible=True
ImageView2.Visible=False
manda =214
Else If man= 20 Then
Label7mp.Text= "Dame"
ImageView1.Visible=False
ImageView2.Visible=True
manda =209
End If
End Sub
 

margret

Well-Known Member
Licensed User
Longtime User
Move the statement:
B4X:
Dim Result As Int
Put this in your Sub Globals and set the default value to 0 so your code is:
B4X:
Sub Globals
     Dim Result As Int : Result = 0
End Sub
Change your code: result = InputList(myList, "Velg mann dame",0) to:
B4X:
result = InputList(myList, "Velg mann dame", result)
 
Last edited:
Upvote 0
Top