B4J Question [solved][B4XPages] Save & Restore pages error?

fredo

Well-Known Member
Licensed User
Longtime User
This solution is really helpful and easy to implement:

The sample project saves the last position correctly, but throws an error when you close the form:


Is there anything I could try here?
 
Last edited:

fredo

Well-Known Member
Licensed User
Longtime User
It seems that for some reason f is null.

This is my temporary workaround:
B4X:
Private Sub FormToPP (f As Form) As PagePosition
    If f = Null Then
        Return CreatePagePosition(0, 0, 400dip, 600dip, False)
    Else
        Return CreatePagePosition(f.WindowLeft, f.WindowTop, f.WindowWidth, f.WindowHeight, f.As(JavaObject).GetFieldJO("stage").RunMethod("isIconified", Null))
    End If
End Sub

It works, but it's not very elegant...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…