Android Question AS TimePickerDialog close?

Jerryk

Active Member
Licensed User
Longtime User
I'm trying to call AS TimePickerDialog component from another B4XPage. If I close the dialog using OK, NO and Cancel button the dialog closes and I stay on the B4XPage that called this dialog. But if I close the dialog using Back button P4XPage closes and I'm on MainPage. Is there a way to fix this?
 

Jerryk

Active Member
Licensed User
Longtime User
To Alexander:
The basic B4XDialog has a Visible method. Your component doesn't have it, nor does it have an As method for casting. Is there a way to check the visibility of a component?
B4X:
Private Sub B4XPage_CloseRequest As ResumableSub
    If TimePickerDialog.Visible Then '- method not exist
        TimePickerDialog.Close
        Return False
    Else
        Return True
    End If
End Sub
 
Last edited:
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
the .dialog is not visible because getDialog cannot use Return Dialog. After renaming the method to getBaseDialog everything works as it should.
Thanks, is fixed now:
 
Upvote 0
Top