Italian [risolto] InvocationTargetException su B4XPage_CloseRequest

sirjo66

Well-Known Member
Licensed User
Longtime User
Finalmente mi sono deciso a studiarmi le B4XPages ed ho cominciato con un po' di video e tutorial.
Ho provato a creare l'app di prova che propone Erel e devo dire che funziona tutto alla perfezione.

Ho solo due pagine, con dentro solo 4 righe di codice, nulla di chè.

Ora, sulla seconda pagina, ho provato ad aggiungere queste righe di codice:

B4X:
' Return True to close, False to cancel
Private Sub B4XPage_CloseRequest As ResumableSub
   Log("Exiting...")
   Return True
End Sub

Ma quando premo il tasto "back" per uscire dalla "page", non mi scrive nulla sul log e mi va in errore:

Error occurred on line: 540 (B4XPagesManager)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1082)
at b4a.example.b4xpagesmanager$ResumableSub_HandleCloseRequest.resume(b4xpagesmanager.java:847)
at b4a.example.b4xpagesmanager._handlecloserequest(b4xpagesmanager.java:814)
at b4a.example.b4xpagesmanager._activity_keypress(b4xpagesmanager.java:569)
at b4a.example.b4xpagesdelegator._activity_keypress(b4xpagesdelegator.java:61)
at b4a.example.main._activity_keypress(main.java:428)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at b4a.example.main$HandleKeyDelayed.runDirectly(main.java:231)
at b4a.example.main$HandleKeyDelayed.run(main.java:228)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.RuntimeException: java.lang.Exception: Sub B4XPage_CloseRequest was not found.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 22 more
Caused by: java.lang.Exception: Sub B4XPage_CloseRequest was not found.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:326)
... 23 more
** Activity (main) Pause event (activity is not paused). **
** Service (starter) Destroy (ignored)**


Perchè ???
Ho cercato sul forum ma non ho trovato nulla a riguardo
 

LucaMs

Expert
Licensed User
Longtime User
Risolto tutto grazie a LucaMs

1685517774101.png


😁
 
Top