[Mono-bugs] [Bug 642760] New: Support more types in Android.Content.ContentValues.Put()

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Sep 30 00:08:35 EDT 2010


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

https://bugzilla.novell.com/show_bug.cgi?id=642760#c0


           Summary: Support more types in
                    Android.Content.ContentValues.Put()
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: chad.kittel at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Presently, only string values are /directly/ usable in
Android.Content.ContentValues.Put(...), anything else is a build error.

For example:
var values = new ContentValues();
values.Put("VarA", "some value"); // works
values.Put("VarB", true);  // build error
values.Put("VarC", 6F);  // build error
values.Put("VarD", 6);  // build error

results in:
error CS1502: The best overloaded method match for
'Android.Content.ContentValues.Put(string, string)' has some invalid
arguments
error CS1503: Argument 2: cannot convert from 'bool' to 'string'
error CS1502: The best overloaded method match for
'Android.Content.ContentValues.Put(string, string)' has some invalid
arguments
error CS1503: Argument 2: cannot convert from 'float' to 'string'
error CS1502: The best overloaded method match for
'Android.Content.ContentValues.Put(string, string)' has some invalid
arguments
error CS1503: Argument 2: cannot convert from 'int' to 'string'

According to intellisense there are overloads for int, float, etc but
all from within the Java.Lang API namespace.  Meaning to use these other types,
syntax like the following is necessary:
values.Put("VarB", new Java.Lang.Boolean(true));

It would be great if we could directly use the relevant c# datatypes (int,
float, bool, etc) in Put() and not have to new up the corresponding
Java.Lang.<Type>.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list