Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9240393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:10:56+00:00 2026-06-18T08:10:56+00:00

I want to use multi choice spinner in mono for android. I want to

  • 0

I want to use multi choice spinner in mono for android.
I want to bind the countries to the spinner
Now in the normal spinner there is label with radio button.
But I want the label with the Checkbox.

can any one please help me.

AlertDialog.Builder alt_bld = new AlertDialog.Builder(
        CareCardActivity.this);
alt_bld.setTitle("Select Recepients");
alt_bld.setMultiChoiceItems(tempname, new boolean[tempname.length] , new DialogInterface.OnMultiChoiceClickListener() {

    public void onClick(DialogInterface dialog, int which,
            boolean isChecked) {
        // TODO Auto-generated method stub

    }
});
alt_bld.setPositiveButton("Ok", new DialogInterface.OnClickListener() {

    public void onClick(DialogInterface dialog, int which) {

        // TODO Auto-generated method stub
        ListView list = ((AlertDialog) dialog).getListView();

        Log.v("LIST COUNT:: ", ""+list.getCount());
        for (int i = 0; i < list.getCount(); i++) {
            boolean checked = list.isItemChecked(i);

            if (checked) {
                sb.append(contactNumber[i]).append(";");
            }
        }
        sb = sb.replace(
                sb.length() - 1,
                sb.length(), "");
        txtPhoneNo.setText(sb.toString());
    }
});

alt_bld.setNegativeButton("Cancel",
        new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });

AlertDialog alert = alt_bld.create();
alert.show();

I have tried this code in the eclipse it is working fine in it, but I want to do it for Mono develop in C#.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:10:57+00:00Added an answer on June 18, 2026 at 8:10 am

    call this function on click of button

    ShowDialog(DIALOG_MULTIPLE_CHOICE); 
    

    Add Following Code

    protected override Dialog OnCreateDialog(int id)
        {
            switch (id) {
            case DATE_DIALOG_ID:
                return new DatePickerDialog(this, OnDateSet, date.Year, date.Month - 1, date.Day);
    
    
    
            case DIALOG_MULTIPLE_CHOICE: {
                var builder = new AlertDialog.Builder (this);
                //          builder.SetIcon (Resource.Drawable.ic_popup_reminder);
                builder.SetTitle ("Select Country");
                builder.SetMultiChoiceItems (countryName, new bool[countryName.Length], MultiListClicked);
    
                builder.SetPositiveButton ("ok", OkClicked);
                builder.SetNegativeButton ("Cancel", CancelClicked);
    
                return builder.Create ();
            }
            }
            return null;
        }
        private void MultiListClicked (object sender, DialogMultiChoiceClickEventArgs e)
        {
            Console.WriteLine ("countryMultiListClicked");
            if (e.IsChecked) {
                mSelectedItems.Add (countryName [(int)e.Which]);
                mSelectedItemsID.Add (countryID [(int)e.Which]);
            }
            else if (mSelectedItems.Contains(countryName [(int)e.Which]))
            {
                mSelectedItems.Remove(countryName [(int)e.Which]);
                mSelectedItemsID.Remove(countryID [(int)e.Which]);
            }
        }
        private void OkClicked (object sender, DialogClickEventArgs e)
        {
            Console.WriteLine ("countryOkClicked");
    
            String listString = "";
            for (int i =0; i<mSelectedItems.Count; i++) {
                listString += mSelectedItems [i] + ",";
            }
            if (listString.Length > 0) {
                listString = listString.Remove (listString.Length - 1);
            }
            et_country.Text = listString;
    
            listStringId = "";
            for (int i =0; i<mSelectedItemsID.Count; i++) {
                listStringId += mSelectedItemsID [i] + ",";
            }
            if (listStringId.Length > 0) {
                listStringId = listStringId.Remove (listStringId.Length - 1);
            }
            Console.WriteLine (listStringId);
        }
        private void CancelClicked (object sender, DialogClickEventArgs e)
        {
            Console.WriteLine("countryCancelClicked");
        }
    

    This works fine ……..!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any reasons not to want to use a multi dimensional SESSION array
I want to use a variable-sized multi-dimensional array in my app to save data.
I've got a multi line text file that I want to use to create
I want to know what framework/Interface/API's Set is best to use to create multi-process
I want to make editable cells with multi-lines content in QTreeWidget and I use
guys I want to input multi-line text into a DataGridTextColumn, I can use enter
I want to use multi-cURL with proxies, but I can't figure out how to
I want to use a QueueSender in a multi-threaded environment. Is QueueSender.send() thread safe?
I need to create a multi-dimensional array in php and want to use it
I'm trying to place the Facebook multi-friend-selector in a Facebox (don't want to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.