Android Question Method not matched/not found

T201016

Active Member
Licensed User
Longtime User
' Hello all!

' When you run applications compiled with the following error:

' An error has occurred in sub:
' java.lang.RuntimeException:
' Method: FirstMethod not found
' in: b4a.example.main

' I wonder what's wrong?
' Please, any help because you correct the error.
' I'm using version JavaObject - 2.01
' thank you In advance!

Sub Globals
Dim NativeMe As JavaObject
End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
NativeMe.InitializeContext
End If
Dim s As String = NativeMe.RunMethod("FirstMethod", Null)
Log(s) 'will print Hello World!
End Sub

#If JAVA
public String FirstMethod() {
return "Hello World!";
}
#End If
 
Last edited:

T201016

Active Member
Licensed User
Longtime User
Thank you very much for your response, and sorry for my poor English. It was my first post. I work currently on B4A version 3.82. I could use a ready example of acting.
 
Upvote 0

cimperia

Active Member
Licensed User
Longtime User
You'll need B4A version 4.30 or greater to use this feature: turorial
 
Upvote 0

T201016

Active Member
Licensed User
Longtime User
Hello! That's what I was afraid that I have an older version of B4A. Thank you for your prompt response and for sending code.
 
Upvote 0
Top