Hello to all,
I have a problem with an application in which to save the settings and use Type RandomAccessFile.
I have the following code
I recently changed this
adding a new field
but now when I go to load the object reflected this error "LastException java.io.EOFException"
in WiFiCfg1 = Rf.ReadObject(Rf.CurrentPosition)
How can I fix?
thank you very much
I have a problem with an application in which to save the settings and use Type RandomAccessFile.
I have the following code
B4X:
Type WiFiCfg(SSID As String,WiFiKey As String,EncryptionKey As String,Channel As Int)
Dim WiFiCfg1 As WiFiCfg
B4X:
Sub SettingsLoad
If File.Exists(File.DirInternal, "Setings.dat") Then
Rf.Initialize(File.DirInternal,"Setings.dat",True)
WiFiCfg1 = Rf.ReadObject(Rf.CurrentPosition)
Rf.Close
End If
End Sub
Sub SettingsWrite
WiFiCfg1.SSID = EditText_SSID.Text
WiFiCfg1.WiFiKey = EditText_WiFiKey.Text
WiFiCfg1.EncryptionKey = Spinner_EncryptionKey.SelectedItem
WiFiCfg1.Channel = Spinner_Channel.SelectedItem
Rf.Initialize(File.DirInternal,"Setings.dat",False)
Rf.WriteObject(WiFiCfg1,False,Rf.CurrentPosition)
Rf.Close
End Sub
I recently changed this
B4X:
Type WiFiCfg(SSID As String,WiFiKey As String,EncryptionKey As String,Channel As Int)
B4X:
Type WiFiCfg(SSID As String,WiFiKey As String,EncryptionKey As String,Channel As Int,Broadcast as Boolean)
but now when I go to load the object reflected this error "LastException java.io.EOFException"
in WiFiCfg1 = Rf.ReadObject(Rf.CurrentPosition)
How can I fix?
thank you very much