Hello, Jay. Can I ask you some questions about gomobile reverse binding in private messaging?
On Thursday, September 12, 2019 at 3:23:24 PM UTC+3, Jay Sharma wrote: > > Hello Elias, > > *First of all, Thank you very much for help. :)* > > > *After I remove the static from function it worked well. * > > > *Thanks* > > On Thursday, September 12, 2019 at 4:31:05 PM UTC+5:30, Elias Naur wrote: >> >> On Thu Sep 12, 2019 at 2:35 AM Jay Sharma wrote: >> > >> > *Hello Elias,* >> > >> > *Following is my java file: * >> > >> > >> > package reversebinding; >> > >> > public class RBinding { >> > public static String getStringFromJava() { >> > return "Hello from java !!"; >> > } >> > } >> > >> > >> > >> >> Your Java method is declared as "static"; static methods are exported as >> regular functions in reverse bindings. Remove "static" and you might have >> better luck calling it. >> >> > >> > *I tried the following in my go file : * >> > >> > >> > >> > import "Java/reversebinding/RBinding" >> > >> > >> > // creating object like this: >> > >> > javaObj := JavaAPI.New() >> > javaObj.GetStringFromJava() >> > >> > *But while building using the gomobile it is giving following error: * >> > JavaObj.GetStringFromJava undefined (type Java.Reversebinding_JavaAPI >> has >> > no field or method GetStringFromJava) >> > undefined: val >> > >> > >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c35486d8-c4e5-4223-9a96-9b29c98c4907%40googlegroups.com.