我有一种方法可以让我返回所有带有用户插入的特定单词的电影。现在我想复制一个列表中的所有详细信息,以便当用户单击应用程序显示的电影时,它会显示带有相应 ID 的祝酒词。
How can i do this?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace App_wrapper
{
public class Result1
{
public int vote_count { get; set; }
public int id { get; set; }
public bool video { get; set; }
public double vote_average { get; set; }
public string title { get; set; }
public double popularity { get; set; }
public string poster_path { get; set; }
public string original_language { get; set; }
public string original_title { get; set; }
public List<int> genre_ids { get; set; }
public string backdrop_path { get; set; }
public bool adult { get; set; }
public string overview { get; set; }
public string release_date { get; set; }
}
public class RootObject
{
public int page { get; set; }
public int total_results { get; set; }
public int total_pages { get; set; }
public List<Result1> results { get; set; }
}
}
试试这个
Public List<Film> filmList;
public class Film
{
private String title;
private String id;
public Film(String title, String id)
{
this.title = title;
this.id = id;
}
public String getId()
{
return id;
}
public override string ToString()
{
return title;
}
}
foreach (var paolo in toor.results)
{
var fItem=new Film{title=paolo.title,id=paolo.id}
filmList.Add(fItem);
}
RunOnUiThread(() =>
{
adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, filmList);
lv.Adapter = adapter;
});
//inside ListView_ItemClick
var id_film = filmList.ElementAt(e.Position).id;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句