i have a master detail page, on my menu when i click on it to navigate to other page, i got this error:
System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'Android.Renderscripts.RenderScript'.'
BUT, it only happen when i'm calling this code:
protected override async void OnAppearing()
{
await LoadContent();
}
If i don't call the LoadContent function, the menu works fine and i'm able to navigate to other pages.
My LoadContent code:
public async Task<firstContentJson> LoadContent()
{
string connectionUrl = "https://myurl.com/app/getcontent.php";
object userInfos = new { };
var jsonObj = JsonConvert.SerializeObject(userInfos);
using (HttpClient client = new HttpClient())
{
StringContent content = new StringContent(jsonObj.ToString(), Encoding.UTF8, "application/json");
var request = new HttpRequestMessage()
{
RequestUri = new Uri(connectionUrl),
Method = HttpMethod.Post,
Content = content
};
var response = await client.SendAsync(request);
string dataResult = response.Content.ReadAsStringAsync().Result;
firstContentJson result = JsonConvert.DeserializeObject<firstContentJson>(dataResult);
try
{
string contentid = JObject.Parse(dataResult)["content_id"].ToString();
string rep = JObject.Parse(dataResult)["rep"].ToString();
string creator = JObject.Parse(dataResult)["creator"].ToString();
string text = JObject.Parse(dataResult)["text"].ToString();
string img = JObject.Parse(dataResult)["img"].ToString();
string totalrate = JObject.Parse(dataResult)["totalrate"].ToString();
//string vid = JObject.Parse(dataResult)["vid"].ToString();
string date = JObject.Parse(dataResult)["date"].ToString();
string name = JObject.Parse(dataResult)["name"].ToString();
string pic = JObject.Parse(dataResult)["pic"].ToString();
string visits = JObject.Parse(dataResult)["visits"].ToString();
string lvl = JObject.Parse(dataResult)["lvl"].ToString();
//inicio load first content
imgTop.Source = "https://myurl.com/" + img;
avUser.Source = "https://myurl.com/" + pic;
txtName.Text = "@"+name;
txtDesc.Text = text;
imgContent.Source = "https://myurl.com/" + img;
txtRate.Text = rep;
if(Convert.ToInt32(totalrate)>0)
{
txtInfos.Text = "Avaliado por " + totalrate + " pessoas";
}
else
{
txtInfos.Text = "Seja o primeiro a avaliar esse conteúdo!";
}
indload.IsVisible = false;
indload.IsRunning = false;
}
catch
{
indload.IsVisible = false;
indload.IsRunning = false;
}
return result;
}
}
Someone can help me, please?
Solution: the problem was a plugin called Sharpnado.Shadows. I removed it from my Master page and everything is working fine again.