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;
}
});
}
As you can see in the image, the var obj
is successfully receiving the Json from a location I have. But at the time of putting the information in listview
the system returns this error to me as the image.
Thank you in advance!