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

  • SEARCH
  • Home
  • 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 8111949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:18:25+00:00 2026-06-06T02:18:25+00:00

Hi I am trying to do the Spinner Tutorial for the Android. http://docs.xamarin.com/android/tutorials/User_Interface/spinner I

  • 0

Hi I am trying to do the Spinner Tutorial for the Android.
http://docs.xamarin.com/android/tutorials/User_Interface/spinner
I am getting the error:
Cannot implicitly convert type 'System.EventHandler<Android.Widget.ItemEventArgs>' to 'System.EventHandler<Android.Widget.AdapterView.ItemSelectedEventArgs>' (CS0029)
on line 26 of my Activity1.cs. I have just copied the code from the tutorial so I am not sure what I need to change this line to so I can run it.
Here is my Activity1.cs :

using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace HelloSpinner
{
[Activity (Label = "HelloSpinner", MainLauncher = true)]
public class Activity1 : Activity
{
    int count = 1;

    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

        // Set our view from the "Main" layout resource
        SetContentView (Resource.Layout.Main);

        Spinner spinner = FindViewById<Spinner> (Resource.Id.spinner);

        spinner.ItemSelected += new EventHandler<ItemEventArgs> (spinner_ItemSelected); 
        var adapter = ArrayAdapter.CreateFromResource (
            this, Resource.Array.planets_array, Android.Resource.Layout.SimpleSpinnerItem);

        adapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
        spinner.Adapter = adapter;
    }

    private void spinner_ItemSelected (object sender, ItemEventArgs e)
    {
        Spinner spinner = (Spinner)sender;

        string toast = string.Format ("The planet is {0}", spinner.GetItemAtPosition (e.Position));
        Toast.MakeText (this, toast, ToastLength.Long).Show ();
    }
}
}
  • 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-06T02:18:26+00:00Added an answer on June 6, 2026 at 2:18 am

    The simplest approach is probably to just use the delegate type declared by the event… ideally using the simpler method group conversion syntax:

    spinner.ItemSelected += spinner_ItemSelected; 
    
    ...
    
    private void spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
    

    (Now you just need a using directive for Android.Widget.)

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

Sidebar

Related Questions

I'm currently trying out the google's various android examples at http://developer.android.com/guide/tutorials/views/hello-spinner.html BUT I can't
I am trying to populate a spinner, but am getting an error. Here is
I'm trying to use the latest version of the jquery.ui.spinner.js . http://wiki.jqueryui.com/w/page/12138077/Spinner The spinners
I'm trying to add an android-like spinner to my mobile website. To put everyone
I'm all new to Android and I'm trying to create a spinner programmatically and
i am new to android, am trying to store the spinner value to the
For an Android application, I'm trying to use a Spinner which, when an option
I've been checking out the spinner wheels at http://code.google.com/p/smooth-wheel/ and it's exactly what I'm
I am beginner to android... Am trying following: In list of spinner items if
I am trying to populate a Spinner in an Android dialog. When the user

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.