Created
April 10, 2019 17:59
-
-
Save felipeslongo/2195fed0f0ffebefa3f4fb112163f1bf to your computer and use it in GitHub Desktop.
Gets the selected/clicked item
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Widget; | |
using Java.Lang; | |
namespace App.Droid.Extensions | |
{ | |
/// <summary> | |
/// Extension method GetItem for <see cref="AdapterView.ItemClickEventArgs"/> | |
/// </summary> | |
/// <seealso cref="https://stackoverflow.com/questions/4819813/how-to-get-text-from-autocomplete-textview-android"/> | |
public static class AdapterView_ItemClickEventArgs_GetItem | |
{ | |
/// <summary> | |
/// Gets the selected/clicked item | |
/// </summary> | |
/// <param name="this"></param> | |
/// <returns></returns> | |
public static Object GetItem(this AdapterView.ItemClickEventArgs @this) | |
=> @this.Parent.GetItemAtPosition(@this.Position); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment