本文整理汇总了C#中ListView.GetItemAtPosition方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.GetItemAtPosition方法的具体用法?C# ListView.GetItemAtPosition怎么用?C# ListView.GetItemAtPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListView
的用法示例。
在下文中一共展示了ListView.GetItemAtPosition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnListItemClick
protected override void OnListItemClick(ListView l, View v, int position, long id)
{
ActivityInfo info = (ActivityInfo) l.GetItemAtPosition(position);
Intent intent = new Intent();
intent.SetComponent(new ComponentName(this, info.Name));
StartActivity(intent);
}
示例2: OnListItemClick
protected override void OnListItemClick(ListView l, Android.Views.View v, int position, long id)
{
base.OnListItemClick(l, v, position, id);
var selectedItem = (ICursor)l.GetItemAtPosition(position);
string url = selectedItem.GetString(selectedItem.GetColumnIndexOrThrow("Url"));
var intent = new Intent();
intent.PutExtra("url", url);
SetResult(Result.Ok, intent);
Finish();
}
示例3: OnListItemClick
protected override void OnListItemClick (ListView l, View v, int position, long id)
{
var selected = l.GetItemAtPosition (position).ToString ();
switch (selected) {
case "MapView":
StartActivity (typeof (MapViewDemo));
break;
case "MapView and Compass":
StartActivity (typeof (MapViewCompassDemo));
break;
}
}
示例4: OnListItemClick
public override void OnListItemClick(ListView l, View v, int position, long id)
{
base.OnListItemClick(l, v, position, id);
ListView.SetItemChecked(position, true);
l.ItemClick += async (object sender, AdapterView.ItemClickEventArgs e) =>
{
string selectedFromList = l.GetItemAtPosition(e.Position).ToString();
try
{
_artistActivity.SetSupportProgressBarIndeterminateVisibility(true);
var artistName = await _repository.FindArtistAsync(selectedFromList);
var artist = await _repository.SearchArtistAsync(artistName);
var toptracks = await _repository.GetTopTracksAsync(artist.Name);
var topAlbums = await _repository.GetTopAlbumsAsync(artist.Name);
// Serialisera objektet och skicka det till artistactivity...
var json = JsonConvert.SerializeObject(artist);
var jsonTopTracks = JsonConvert.SerializeObject(toptracks);
var jsonTopAlbums = JsonConvert.SerializeObject(topAlbums);
var artistActivity = new Intent(this.Activity, typeof(ArtistActivity));
artistActivity.PutExtra("Artist", json);
artistActivity.PutExtra("TopTracks", jsonTopTracks);
artistActivity.PutExtra("TopAlbums", jsonTopAlbums);
StartActivity(artistActivity);
_artistActivity.SetSupportProgressBarIndeterminateVisibility(false);
}
catch (Exception ex)
{
Toast.MakeText(this.Activity, "Error: " + ex.Message, ToastLength.Short).Show();
}
};
}
示例5: OnListItemClick
// @SuppressWarnings("unchecked")
protected override void OnListItemClick (ListView l, View v, int position, long id)
{
var map = (IDictionary<String, Object>)l.GetItemAtPosition (position);
Intent intent = (Intent)map ["intent"];
StartActivity (intent);
}
示例6: OnListItemClick
override protected void OnListItemClick(ListView listView, View view, int position, long id)
{
IMap<String, Object> map = (IMap<String, Object>)listView.GetItemAtPosition(position);
Intent intent = (Intent)map.Get(INTENT_KEY);
StartActivity(intent);
}