Is it possible to make a Preferences Dialog modal, so the program stopps while the user puts in data, and returns to the code after Ok or Cancel is pressed?
Thanks for reading this,
after browsing the documentation I found for me following solution.
Regards
Bernhard
B4X:
...
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
Sub OpenConfiguration As Resumable
...
Return True 'you can return a different value if needed
End Sub
Wait For (OpenConfiguration) Complete (unused As Boolean)