Android Question StateManager - error - can't save app

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

I started to use the StateManager. After downloading it and unzipping it, I copied StateManager.bas into my project where the other .bas files were located. I added it into the project as an existing module and it showed up as a tab so I could see the coding of the module. When I tried to save the project I got an error on the If statement. Is this module incomplete?

This is the If statement that gave the error:

B4X:
If Settings.IsInitialized = False Then

This is the Sub that has the If statement:

B4X:
Sub GetSetting2(Key As String, DefaultValue As String)
    If Settings.IsInitialized = False Then
        'load the stored settings
        If File.Exists(File.DirInternal, settingsFileName) Then
            Settings = File.ReadMap(File.DirInternal, settingsFileName)
        Else
            Return DefaultValue
        End If
    End If
    Dim v As String
    v = Settings.GetDefault(Key.ToLowerCase, DefaultValue)
    Return v
End Sub
 

rleiman

Well-Known Member
Licensed User
Longtime User
Here's the changed module.

I have to test it with the sample coding from the tutorial Erel posted to see if my changes are ok.
 

Attachments

  • StateManager.bas
    6.9 KB · Views: 125
Upvote 0
Top