diff --git a/FiredTVLauncher/Settings.cs b/FiredTVLauncher/Settings.cs index de52306..ce6aa84 100644 --- a/FiredTVLauncher/Settings.cs +++ b/FiredTVLauncher/Settings.cs @@ -133,13 +133,13 @@ ISharedPreferencesEditor editPrefs () return prefs.Edit (); } - public static string GetWallpaperFilename() + public static string GetWallpaperFilename(bool checkExist = true) { try { var path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); var filename = System.IO.Path.Combine(path, "wallpaper.png"); - if (File.Exists (filename)) + if (File.Exists (filename) || !checkExist) return filename; } catch { } diff --git a/FiredTVLauncher/SettingsActivity.cs b/FiredTVLauncher/SettingsActivity.cs index aa4a8f5..8782801 100644 --- a/FiredTVLauncher/SettingsActivity.cs +++ b/FiredTVLauncher/SettingsActivity.cs @@ -60,13 +60,13 @@ protected override void OnCreate (Bundle bundle) try { var http = new System.Net.WebClient (); var bytes = http.DownloadData (url); - var filename = Settings.GetWallpaperFilename (); + var filename = Settings.GetWallpaperFilename (false); System.IO.File.WriteAllBytes (filename, bytes); } catch (Exception ex) { Settings.Instance.WallpaperUrl = string.Empty; - Toast.MakeText (this, "Failed to Download Wallpaper", ToastLength.Long).Show (); + RunOnUiThread (() => Toast.MakeText (this, "Failed to Download Wallpaper", ToastLength.Long).Show ()); Log.Error ("Downloading Wallpaper Failed", ex); }