Skip to content

Commit 6a994c0

Browse files
authored
Android: Hide "Downloading data" dialog if download fails (#829)
1 parent f439b38 commit 6a994c0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Android/Xamarin.Android/MainActivity.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,16 @@ private async void CategoriesListViewOnChildClick(object sender, ExpandableListV
104104
AlertDialog dialog = builder.Create();
105105
dialog.Show();
106106

107-
// Begin downloading data.
108-
await DataManager.EnsureSampleDataPresent(item);
109-
110-
// Hide the progress dialog.
111-
dialog.Dismiss();
107+
try
108+
{
109+
// Begin downloading data.
110+
await DataManager.EnsureSampleDataPresent(item);
111+
}
112+
finally
113+
{
114+
// Hide the progress dialog.
115+
dialog.Dismiss();
116+
}
112117
}
113118

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

0 commit comments

Comments
 (0)