Android Question Runtime Error on MsgboxAsync2

Azhar

Active Member
Licensed User
Hello Everyone,

I have no idea as to why this is causing a runtime error. My application errors out on Result = Msgbox2Async("Please.....
The Logs are as follows:

Error occurred on line: 63 (saveRWY)
java.lang.NumberFormatException: For input string: "android.app.AlertDialog@96811e"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at anywheresoftware.b4a.debug.RDebugUtils.numberCast(RDebugUtils.java:63)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7352)
at android.widget.TextView.performClick(TextView.java:14230)
at android.view.View.performClickInternal(View.java:7318)
at android.view.View.access$3200(View.java:846)
at android.view.View$PerformClick.run(View.java:27800)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)




B4X:
Sub btnSave_Click
    Dim OK_Proceed As Boolean = False
    Dim Result As Int
    Dim strLocName As String
    
    'validation checks on Airport Code and Length of Airport Name
    'code
    If common.Len(tbCode.Text) <> 4 Then
        Result = Msgbox2Async("Please keep CODE to 4 characters exactly!", "Invalid Airport Code", "OK", "", "", Null, False)
        Wait For Msgbox_Result (Result As Int)
        If Result = DialogResponse.POSITIVE Then
            tbCode.RequestFocus
        End If
    Else
        OK_Proceed = True
    End If

In fact, all my 'MsgboxAsync2 routines fail in the same way.
I'm running B4A v10.7 using android-30 and java jdk-11.0.1

Hope someone can put some light on this annoying error.

Thanks,

Azhar
 

Azhar

Active Member
Licensed User
Correct code:
B4X:
Msgbox2Async("Question?", "Title", "Yes", "Cancel", "No", Null, False)
Wait For Msgbox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
    '...
End If

Oh deary me!
It's been a long day!!

Thanks Erel
 
Upvote 0
Top