casting - convert Java.Lang.Object to .net type -


I want to put a spinner. Since the selected item is a java. Lung Object, I have to know that I am a Java. Lung How can I put the object in a native net net? Thanks, Alex

"post-text" itemprop = "text">

You're binding on the spinner, but I'm assuming that it's just a list of strings? If this is the case, then one possibility is that

  spinner.selected.Template.String ()   

This will not be very useful if the underlying object is a Not a string, though. You have some other options available such as you can use the spinner. Select to get items from the source of the selector spinner adapter. I like something:

  var source = new list & lt; String & gt; {"One", "b", "c"}; Spinner Adapter = new Arrayheader & lt; String & gt; (This, resource. Layout, item, resource.id.name, source); Var selectedString = source [spinner.SelectedItemPosition];   

You can also:

  var selectedString = spinner.GetItemAtPosition [spinner.SelectedItemPosition]. Ostring ();   

All of this depends on what you are trying to do and when. Xamarin is the one who uses the basics of using a spinner.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -