当前位置: 首页>>代码示例>>C#>>正文


C# ListView.GetItemAtPosition方法代码示例

本文整理汇总了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);
 }
开发者ID:Harshadcse,项目名称:monodroid-samples,代码行数:7,代码来源:MainActivity.cs

示例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();
        }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:12,代码来源:HistoryActivity.cs

示例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;
			}
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:13,代码来源:MapsDemo.cs

示例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();
                }
            };
        }
开发者ID:jonteho,项目名称:last.fm-appcrossplat,代码行数:37,代码来源:FragmentSimilarArtists.cs

示例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);
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:8,代码来源:SampleList.cs

示例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);
 }
开发者ID:MahendrenGanesan,项目名称:samples,代码行数:6,代码来源:PlusSampleActivity.cs


注:本文中的ListView.GetItemAtPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。