On May 25, 2012, at 3:41 AM, Dariusz Sroka wrote:
> I'm using 3rd part java library and I need to use Java.Lang.Object as 
> parameter in one of the methods.
> 
> How can I convert .net custom class to Java.Lang.Object? Any examples?

You'll need to create a wrapper object:

        class Holder<T> : Java.Lang.Object {
                public readonly T Value;

                public Holder (T value)
                {
                        this.Value = value;
                }
        }

Then create a new instance when invoking Java code:

        view.Tag = new Holder<LibraryType>(value);
        LibraryType taggedValue = ((Holder<LibraryType>) view.Tag).Value;

 - Jon

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to