Widget Crashes while showing Number Dialog

skyluke83

Member
Licensed User
Longtime User
Dear Erel & all the B4A staff,

i am trying to implement a widget with a lock/unload feature requesting a PIN number. I have a panel, so when i click on it, it fires the following code:

Sub pnlMain_Click
Dim myUnlockedState As Boolean
myUnlockedState = bUnlocked

If myUnlockedState Then
myUnlockedState = False
Else
Dim nd As NumberDialog
Dim ret As Long*
nd.Digits = 5
nd.Number = 99999
nd.Decimal = 0
nd.ShowSign = False
ret = nd.Show("Unlock Screen", "Ok", "Cancel", "", Null)
If ret = 99999 Then
myUnlockedState = True
Else
ToastMessageShow("Invalid code!", True)
End If
End If

LockUnlock(myUnlockedState)
bUnlocked = myUnlockedState
End Sub

The problem is that i get an exception (not shown) and the service crashes on the line that shows the dialog.. what am i doing wrong?

:sign0085::sign0085::sign0085::sign0085::sign0085:

Thanks dudes
Luca
 
Last edited:
Top