diff --git a/src/Android/MainActivity.cs b/src/Android/MainActivity.cs
index bfb9282f36..669e918709 100644
--- a/src/Android/MainActivity.cs
+++ b/src/Android/MainActivity.cs
@@ -99,7 +99,7 @@ namespace Bit.Droid
}
else if(message.Command == "updatedTheme")
{
- Recreate();
+ RestartApp();
}
});
}
@@ -273,5 +273,15 @@ namespace Bit.Droid
SetTheme(Resource.Style.MainTheme);
}
}
+
+ private void RestartApp()
+ {
+ var intent = new Intent(this, typeof(SplashActivity));
+ var pendingIntent = PendingIntent.GetActivity(this, 5923650, intent, PendingIntentFlags.CancelCurrent);
+ var alarmManager = GetSystemService(AlarmService) as AlarmManager;
+ var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + 500;
+ alarmManager.Set(AlarmType.Rtc, triggerMs, pendingIntent);
+ Java.Lang.JavaSystem.Exit(0);
+ }
}
}
diff --git a/src/App/Pages/Settings/OptionsPage.xaml b/src/App/Pages/Settings/OptionsPage.xaml
index 105ef7dda3..05162f78ba 100644
--- a/src/App/Pages/Settings/OptionsPage.xaml
+++ b/src/App/Pages/Settings/OptionsPage.xaml
@@ -86,8 +86,9 @@
StyleClass="box-value" />
+ x:Name="_themeDescriptionLabel" />
diff --git a/src/App/Pages/Settings/OptionsPage.xaml.cs b/src/App/Pages/Settings/OptionsPage.xaml.cs
index 4295aaf1b2..19308be5c9 100644
--- a/src/App/Pages/Settings/OptionsPage.xaml.cs
+++ b/src/App/Pages/Settings/OptionsPage.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using Bit.App.Resources;
+using System;
using Xamarin.Forms;
namespace Bit.App.Pages
@@ -15,6 +16,11 @@ namespace Bit.App.Pages
_themePicker.ItemDisplayBinding = new Binding("Value");
_uriMatchPicker.ItemDisplayBinding = new Binding("Value");
_clearClipboardPicker.ItemDisplayBinding = new Binding("Value");
+ if(Device.RuntimePlatform == Device.Android)
+ {
+ _themeDescriptionLabel.Text = string.Concat(_themeDescriptionLabel.Text, " ",
+ AppResources.RestartIsRequired);
+ }
}
protected async override void OnAppearing()
diff --git a/src/App/Pages/Settings/OptionsPageViewModel.cs b/src/App/Pages/Settings/OptionsPageViewModel.cs
index e833a1f1d1..17c79a015d 100644
--- a/src/App/Pages/Settings/OptionsPageViewModel.cs
+++ b/src/App/Pages/Settings/OptionsPageViewModel.cs
@@ -177,7 +177,8 @@ namespace Bit.App.Pages
await _storageService.SaveAsync(Constants.ThemeKey, theme);
if(Device.RuntimePlatform == Device.Android)
{
- await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
+ await _deviceActionService.ShowLoadingAsync(AppResources.Restarting);
+ await Task.Delay(1000);
}
_messagingService.Send("updatedTheme", theme);
}
diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs
index 9fd8a198c9..c092e50471 100644
--- a/src/App/Resources/AppResources.Designer.cs
+++ b/src/App/Resources/AppResources.Designer.cs
@@ -3057,6 +3057,24 @@ namespace Bit.App.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Restarting....
+ ///
+ public static string Restarting {
+ get {
+ return ResourceManager.GetString("Restarting", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Restart is required..
+ ///
+ public static string RestartIsRequired {
+ get {
+ return ResourceManager.GetString("RestartIsRequired", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Re-type Master Password.
///
diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx
index ec5d8588da..772231572d 100644
--- a/src/App/Resources/AppResources.resx
+++ b/src/App/Resources/AppResources.resx
@@ -1557,4 +1557,11 @@
Change the application's color theme.
+
+ Restart is required.
+ Referring to restarting the application.
+
+
+ Restarting...
+
\ No newline at end of file