[mono-android] Getting the name of a spinner

Tomasz Cielecki tomasz at ostebaronen.dk
Tue Nov 8 01:56:41 EST 2011


In the activity where you have the spinners. You could go around by
doing something like this:

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

Or if you are inside the event handler. The sender should be the spinner:

   Spinner spinner = sender as Spinner
   if (spinner.Id = Resource.Id.bodyCondSpinner)
      //do something

On Tue, Nov 8, 2011 at 1:09 AM, Paul Johnson
<paul at all-the-johnsons.co.uk> wrote:
> Hi,
>
> On 7 November 2011 23:28, Tomasz Cielecki <tomasz at ostebaronen.dk> wrote:
>>
>> Isn't it possible to get the id of a spinner? Set an id for each them?
>
> As in
>
> <Spinner
>       android:id="@+id/bodyCondSpinner"/>
>
> Yes, but how do I then get that id name back?
>
>
> Paul
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk


More information about the Monodroid mailing list