Skip to content

Commit

Permalink
Android: Hide "Downloading data" dialog if download fails (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstefarov authored Nov 19, 2020
1 parent f439b38 commit 6a994c0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Android/Xamarin.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,16 @@ private async void CategoriesListViewOnChildClick(object sender, ExpandableListV
AlertDialog dialog = builder.Create();
dialog.Show();

// Begin downloading data.
await DataManager.EnsureSampleDataPresent(item);

// Hide the progress dialog.
dialog.Dismiss();
try
{
// Begin downloading data.
await DataManager.EnsureSampleDataPresent(item);
}
finally
{
// Hide the progress dialog.
dialog.Dismiss();
}
}

// Each sample is an Activity, so locate it and launch it via an Intent.
Expand Down

0 comments on commit 6a994c0

Please sign in to comment.