from a previous example I've found this java code to generate an event, which originally was in the Main module
the event is referenced with
I understand that the ".main$NetworkCallback" string in the event.InitializeNewInstance call refers to the java code in the Main module.
In a B4XPages world, where I'd like to put all the network related calls in a separate class (for example named : NetTools) how the string should be changed?
Should it contain the Class name ("NetTools$NetworkCallback") or the object instance name ("toolnamexample$NetworkCallback") or some other mangling derived from B4A internal object structure?
B4X:
#if Java
public static class NetworkCallback extends android.net.ConnectivityManager.NetworkCallback {
public void onAvailable(android.net.Network network) {
processBA.raiseEventFromUI(null, "network_available", network);
}
}
#End If
the event is referenced with
B4X:
Dim event As JavaObject
event.InitializeNewInstance(Application.PackageName & ".main$NetworkCallback", Null)
manager.RunMethod("requestNetwork", Array(builder.RunMethod("build", Null), event))
Wait For network_available (Network As Object)
I understand that the ".main$NetworkCallback" string in the event.InitializeNewInstance call refers to the java code in the Main module.
In a B4XPages world, where I'd like to put all the network related calls in a separate class (for example named : NetTools) how the string should be changed?
Should it contain the Class name ("NetTools$NetworkCallback") or the object instance name ("toolnamexample$NetworkCallback") or some other mangling derived from B4A internal object structure?