this is a piece of my code in xamarin android , When Vs 2017 want to execute the line "await Task.Delay(200);" , the error mentioned in title will apear, please tell me if anybody know about that
private async void _btnanswer2_Click(object sender, EventArgs e)
{
if(Ans == 2)
{
_btnanswer2.SetBackgroundColor(Android.Graphics.Color.ParseColor("#006400"));
mScore = mScore + 1;
_txtscore.Text = "امتیاز: " + mScore.ToString();
}
else
{
_btnanswer2.SetBackgroundColor(Android.Graphics.Color.ParseColor("#FF0000"));
}
await Task.Delay(200); //Error after Execute this line
_btnanswer2.SetBackgroundColor(Android.Graphics.Color.ParseColor("0091EA"));
bandeira++;
RefreshQue();
}