...
OpenConfiguration
Wait For OpenConfiguration_Complete
...
Sub OpenConfiguration
pfdialog.LoadFromJson(File.ReadString(File.DirAssets,"prefs.json"))
Wait For (pfdialog.ShowDialog(PrefData, "OK", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dim ser As B4XSerializator
File.WriteBytes(xui.DefaultFolder,PrefsFile,ser.ConvertObjectToBytes(PrefData))
End If
CallSubDelayed(Me, "OpenConfiguration_Complete")
End Sub