Inherit class from AndroidJavaObject

Hi, I have a class defined like this:

public class JavaIntent : AndroidJavaObject {	
    public JavaIntent () : base("android.content.Intent")

And using it like:

public static void StartIntentChooser(JavaIntent intent)
	var player = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
	var activity = player.GetStatic<AndroidJavaObject>("currentActivity");
	activity.Call("startActivity", intent); 

I’m trying to make wrappers to Android SDK’s classes, but I’m getting this error:

JNI: Unknown signature for type ‘JavaIntent’ (obj = JavaIntent) instance

Does any one have a clue of what’s going on?



Inspecting the assmebly browser I found that calls to AndroidJavaObject make a type check like this one:

if (typeof(ReturnType) == typeof(AndroidJavaObject))
	IntPtr jobject = AndroidJNI.CallObjectMethod (this.m_jobject, cachedMethodID, args2);
	return (ReturnType)new AndroidJavaObject (jobject);

My JavaIntent class, derived from AndroidJavaObject doesn’t pass this check.

I thought about making a custom AndroidJavaObject class, but that may be hard. Does any one have a better approach?

Thanks again,

I tried to get working something similar but gave up eventually because of various strange runtime errors. Although AndroidJavaObject can technically be subclassed, it seems to me that it was not designed to be subclassed.