[mono-android] [Monodroid] SetTag and the Java.Lang.Object

Tom Opgenorth tom at opgenorth.net
Sun Mar 13 12:36:23 EDT 2011


Just came across this same behavior in P14.  Bug report says it's
closed, could this be a regression?

https://bugzilla.novell.com/show_bug.cgi?id=635129



On Sun, Aug 29, 2010 at 22:07, Amir (GMail) <amirw2k at gmail.com> wrote:
> I've submitted a bug, and it shows as Fixed! I'll be waiting for next
> version to check it.
>
> Thanks,
> Amir
>
> -----Original Message-----
> From: Joseph Hill [mailto:jhill at novell.com]
> Sent: Saturday, August 28, 2010 2:06 AM
> To: Amir (GMail); Jonathan Pobst
> Cc: monodroid at lists.ximian.com
> Subject: Re: [Monodroid] SetTag and the Java.Lang.Object
>
> As far as (1), we convert set* methods to properties, so instead of:
> button.setTag("2");
>
> You would want to use:
> button.Tag = "2";
>
> That said, this will hit the same issue as (2) - the compiler won't do an
> implicit conversion of string to Java.Lang.Object.
>
> --Joseph
>
>
>  >>>
>> Should be pretty easy for us to fix.
>>
>> Please file a bug.
>>
>> Jonathan
>>
>>
>> On 8/27/2010 6:01 AM, Amir (GMail) wrote:
>> > Hi,
>> >
>> > I'm trying to set a Tag for a View, but it seems to be overly
> complicated.
>> >
>> > For example, in Java this code works:
>> >
>> > Button button;
>> >
>> > button.setTag("2");
>> >
>> > But in MonoDroid it fails because:
>> >
>> > 1. There is no implementation of setTag(object) but only of setTag
>> >
> <http://developer.android.com/reference/android/view/View.html#setTag(int,
>> > java.lang.Object)>(int key, Object
>> > <http://developer.android.com/reference/java/lang/Object.html> tag)
>> >
>> > 2. It won't work even if I use a key: button.SetTag(0, "2"). The
>> > compiler complains that "2" isn't a Java.Lang.Object but it actually is
>> > an object!
>> >
>> > I'd like to use any type of C# object as a Tag. Is there a quick fix or
>> > a recommended way to handle this annoyance?
>> >
>> > Thanks,
>> >
>> > Amir
>> >
>> >
>> >
>> > _______________________________________________
>> > Monodroid mailing list
>> > Monodroid at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/monodroid
>>
>> _______________________________________________
>> Monodroid mailing list
>> Monodroid at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 5403 (20100827) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodroid
>



-- 
http://www.opgenorth.net


More information about the Monodroid mailing list