My app is using Map to store settings. I tried it on a different computer with a new emulator and now it is force closing at startup. Log shows:
Caused by: java.io.FileNotFoundException: /data/data/myB4Aprog/files/Map.dat (No such file or directory)
In Activity_Create I am using:
What am I doing wrong? I am thinking if the file doesn't exist it will create it with the above values.
Caused by: java.io.FileNotFoundException: /data/data/myB4Aprog/files/Map.dat (No such file or directory)
In Activity_Create I am using:
B4X:
If File.Exists(File.DirInternal,"Map.dat") = False Then
Map1.Initialize
Map1.Put("DefHeight","in")
Map1.Put("DefWeight","kg")
File.WriteMap(File.DirInternal, "Map.dat", Map1)
Else
Map1 = File.ReadMap(File.DirInternal,"Map.dat")
DefHeight = Map1.Get("DefHeight")
DefWeight = Map1.Get("DefWeight")
End If
What am I doing wrong? I am thinking if the file doesn't exist it will create it with the above values.