The
sam_interface must be a Java SAM interface, meaning it must only have a single abstract method to implement.
The
callable must be able to handle the same parameter types as the SAM interface method, and must provide the same return type. The
callable will be invoked as a callback, passing the arguments from the Java SAM interface method.
var cb = func (content: String) -> void:
print(content)
var callback = JavaClassWrapper.create_sam_callback("android.util.Printer", cb)
callback.println("Hello Godot World!")
Note: This method only works on Android. On every other platform, this method will always return
null.