Hi,
I try to use a 3rd party library with JNI.
I have the following java method header:
public static native int Msg_UpdateOptions(int lIdentifier, boolean bEnabled,
boolean bQueue, String functionName, int convention, Object callBackObj);
I import the method with this code:
public static int Msg_UpdateOptions(uint lIdentifier, bool bEnabled, bool
bQueue, String functionName, int convention, Java.Lang.Object callBackObj)
{
IntPtr methodId = JNIEnv.GetStaticMethodID(mAlkClass,
"Msg_UpdateOptions", "(IZZLjava/lang/String;ILjava/lang/Object;)I");
return JNIEnv.CallStaticIntMethod(mAlkClass, methodId, new JValue[] {
new JValue(lIdentifier),
new JValue(bEnabled),
new JValue(bQueue),
new JValue(new Java.Lang.String(functionName)),
new JValue(convention),
new JValue(callBackObj)
});
}
In the Java sample the method is used in this way:
Msg_UpdateOptions(AlkMsg.MSG_ID_TurnInstructions, true, false,
"OnTurnInstructionReceived", 0, this );
Where 'this' is an activity and OnTurnInstructionReceived is a method of the
actvity.
public void OnTurnInstructionReceived(int buffer, int len)
{
}
When I try this in c#, my app crashes without an error. I think the library try
to call my OnTurnInstructionReceived method. Does anyone have an idea what is
wrong?
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid