Unhandled
Exception:
System.InvalidProgramException: Invalid IL code in
HypoScan.MainActivity/<ShowBusyIndicator>d__11:MoveNext ():
IL_005d: callvirt 0x0a000e16
The void ShowBusyIndicator looks like this and has always worked before:
async void ShowBusyIndicator(bool IncludeNewCalculation)
{
var busyIndicator = new SfBusyIndicator(viewpager.Context);
busyIndicator.IsBusy = true;
busyIndicator.ViewBoxHeight = 100;
busyIndicator.ViewBoxWidth = 100;
busyIndicator.AnimationType = AnimationTypes.GearBox;
busyIndicator.Title = "Processing...";
busyIndicator.TextSize = 20;
busyIndicator.TextColor = General.GetAndroidGraphicsColor(viewpager.GetChildAt(4).Context, Resource.Color.DarkerGray);
busyIndicator.SetBackgroundColor(General.GetAndroidGraphicsColor(viewpager.GetChildAt(4).Context, Resource.Color.LighterGray));
var layout = viewpager.GetChildAt(4).FindViewById<LinearLayout>(Resource.Id.LinearLayout5);
layout.RemoveAllViews();
layout.AddView(busyIndicator);
await Task.Delay(1000);
if (IncludeNewCalculation == true)
{
General.FinancialPlanningCalculation(viewpager.GetChildAt(4));
}
TabFragment5.SetLayout(viewpager.GetChildAt(4));
busyIndicator.IsBusy = false;
busyIndicator.Visibility = Android.Views.ViewStates.Invisible;
}
What is going wrong?