[Mono-bugs] [Bug 675194] New: AlertDialog.Builder.SetMultiChoiceItems() doesn't show selection properly.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 25 15:15:35 EST 2011


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

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


           Summary: AlertDialog.Builder.SetMultiChoiceItems() doesn't show
                    selection properly.
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mkestner at novell.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


AlertDialog.Builder.SetMultiChoiceItems() doesn't show selection properly.

Create a new "Hello, World" project, and add the following to
Activity.OnCreate():

    var items = new[]{
        new { Name = "option1", Checked = true },
        new { Name = "option2", Checked = false },
        new { Name = "option3", Checked = false },
        new { Name = "fourth option", Checked = true },
        new { Name = "last", Checked = false },
    };

    var dialog = new AlertDialog.Builder(this);
    dialog.SetMultiChoiceItems(
            items.Select (i => i.Name).ToArray (),
            items.Select (i => i.Checked).ToArray (),
            (o, e) => {
        Log.Debug ("*jonp*", "SetMultiChoiceItems: Which={0}; IsChecked={1}",
            e.Which, e.IsChecked);
    });
    dialog.SetTitle("Select columns");
    dialog.SetPositiveButton("Save", (o, e) => {
        Log.Debug ("*jonp*", "Save: Which={0}", e.Which);
    });
    dialog.Create().Show();

Build, Run.

Actual output:

http://gyazo.com/a255ef366ee02bba28c0a6f7d33094eb.png

In case the above disappears, the salient point is that it shows:

    option1             [X]
    option2             [ ]
    option3             [ ]
    fourth option    [ ]
    last                   [ ]

However, it *should* show:

    option1             [X]
    option2             [ ]
    option3             [ ]
    fourth option    [X]
    last                   [ ]

The 4th index of the bool[] passed to SetMultiChoiceItems() is apparently
getting marshaled incorrectly.

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


More information about the mono-bugs mailing list