Forum Xamarin.Android

Indeterminate ProgressBar

Hi,
I want to make indeterminate progress bar that will pop up when I am loading a file, after the file is loaded and fragment pops up.
I have tried this: https://forums.xamarin.com/discussion/12351/how-to-show-a-progress-bar-just-in-time but it doesnt work because I need to finnish loading file before I open my fragment, and I cant await LoadingFile() because I have button in Options Menu:
public override bool OnOptionsItemSelected(IMenuItem item)
{
int id = item.ItemId;
Android.App.FragmentTransaction trans = FragmentManager.BeginTransaction();
switch (id)
{
case Resource.Id.preview:
LoadingFile();
dialog_Preview dialogPreview = new dialog_Preview();
dialogPreview.Show(trans, "Dialog");
return true;
}
return base.OnOptionsItemSelected(item);
}

Does anyone have any other idea how to do this?

Sign In or Register to comment.