This content has been marked as final. Show 2 replies
Is it possible to return more than one argument in java callback function.Of course. A 'callback function' is just a method like any other.
what are the changes require to return more than one arg?1. Adjust the method declaration in the class you are calling.
2. Compile the class.
3. Run javap -s to see the new signature.
4. Adjust the signature in GetMethod() accordingly in your code.
5. Adjust the CallVoidMethod() call to pass the necessary parameters.
902551 wrote:Just to be clear you really do mean that you want to call the method with more than one argument?
Is it possible to return more than one argument in java callback function.
Versus a "return" value from the method call of which there can be at most one and which your example has none.
And for the future you can do anything in JNI that you can do in Java. And the JNI code often looks the same even if it takes more lines to do it.