1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-11 13:53:29 +00:00

restart app after theme change

This commit is contained in:
Kyle Spearrin
2019-05-29 23:02:30 -04:00
parent 6e91d66b2c
commit cc8b8f9ceb
6 changed files with 47 additions and 4 deletions

View File

@@ -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);
}
}
}