Good morning,
regarding the code for writing TUI interfaces already started in a previous post (
https://www.b4x.com/android/forum/threads/solved-lanterna.161843/#post-992685)
I'm trying to understand how to call a modal window that accepts the classic "YES" and "No" to understand how to proceed.
I tried adding this sub to the code:
[CODE lang="b4x" title="Code"]Sub ShowMessageDialog(title As String, message As String)
' Inizializza MessageDialogButton staticamente
Dim MessageDialogButton As JavaObject
MessageDialogButton.InitializeStatic("com.googlecode.lanterna.gui2.dialogs.MessageDialogButton")
' Ottiene il pulsante OK staticamente
Dim buttonOK As Object = MessageDialogButton.GetField("OK")
' Inizializza MessageDialog e chiama il metodo showMessageDialog
Dim MessageDialog As JavaObject
MessageDialog.InitializeStatic("com.googlecode.lanterna.gui2.dialogs.MessageDialog")
' Esegui il metodo showMessageDialog con i parametri corretti
MessageDialog.RunMethod("showMessageDialog", Array As Object(gui, title, message, Array As Object(buttonOK)))
End Sub[/CODE]
and then recall it via:
[CODE lang="b4x" title="code2"]ShowMessageDialog("WARNING", "Operazione non rilevata!")[/CODE]
Unfortunately I always get the following response:
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Method: showMessageDialog not matched.
Can you give me some suggestions?