I just tried adding the save form position code to my B4J project and on running it crashed with an exception.
The sample code misses two lines of code:
In B4XPage_Created you need to add:
..where the X's are of your choice.
The code in the sample.zip is correct and includes these two lines.
[B4XPages] Save the pages size and position
Add to B4XMainPage: Type PagePosition (Left As Int, Top As Int, Width As Int, Height As Int, IsIconified As Boolean) Private kvs As KeyValueStore And: Public Sub SavePagePosition (Page As Object) Dim f As Form = B4XPages.GetNativeParent(Page) If f = Null Or f.IsInitialized = False...
www.b4x.com
The sample code misses two lines of code:
In B4XPage_Created you need to add:
B4X:
xui.SetDataFolder("XXXXXX")
kvs.Initialize(xui.DefaultFolder, "XXX.dat")
The code in the sample.zip is correct and includes these two lines.