The forum solved my last problem, and now for a new one
How do you check and uncheck a checkbox at runtime?? Here is what I am trying:
I have tried using Invalidate but that doesn't work. I have confirmed that FavStartup in fact does equal True with:
On a side note, do I need the Dim Map1 as Map each time I am accessing map1? I was just following the examples Erel did in the post "Text Files".
How do you check and uncheck a checkbox at runtime?? Here is what I am trying:
B4X:
Sub Activity_Create(FirstTime As Boolean)
If File.Exists(File.DirInternal,"Map.txt") = True Then
Dim Map1 As Map
Map1 = File.ReadMap(File.DirInternal,"Map.txt")
FavStartUp = Map1.Get("FavStartUp")
Else
Dim Map1 As Map
Map1.Initialize
Map1.Put("FavStartUp","False")
File.WriteMap(File.DirInternal, "Map.txt", Map1)
End If
chkFavStartup.Initialize("")
If FavStartUp = "True" Then
chkFavStartup.Checked = True
Else
chkFavStartup.Checked = False
End If
End Sub
I have tried using Invalidate but that doesn't work. I have confirmed that FavStartup in fact does equal True with:
B4X:
Sub Button1_Click
Dim Map1 As Map
Map1 = File.ReadMap(File.DirInternal,"Map.txt")
Msgbox(Map1.Get("FavStartUp"),"")
End Sub
On a side note, do I need the Dim Map1 as Map each time I am accessing map1? I was just following the examples Erel did in the post "Text Files".