0
I have the following code
private void WbRanking_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
{
RunOnUiThread(() =>
{
string json = Encoding.UTF8.GetString(e.Result);
//lstRanking = JsonConvert.DeserializeObject<List<string>>(json);
var obj = JsonValue.Parse(json);
//var obj = JsonConvert.DeserializeObject<List<string>>(json);
JsonTextReader reader = new JsonTextReader(new StringReader(json));
ArrayAdapter<string> adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, obj);
while (reader.Read())
{
if (reader.Value != null)
{
//string nome = obj[0];
lstRanking.Add("Nome " + obj[0] + "Sobrenome " + obj[1]);
}
lsvRanking.Adapter = adapter;
}
});
}
How is it possible to see in the image the var obj
is successfully receiving Json from a Rest api that I have local. But it’s time to put the information in the listview
the system returns me this error as per the image.
Thank you in advance!
Actually I’m already using but it’s not working.
– Rafaelqueiroz
did not know how to put here updated the answer... hehehe
– João Rafael Colombo