+ // Get a handle for the shared preferences.
+ SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
+
+ // Get the theme and screenshot preferences.
+ boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
+ boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+
+ // Disable screenshots if not allowed.
+ if (!allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Set the theme.
+ if (darkTheme) {
+ setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
+ } else {
+ setTheme(R.style.PrivacyBrowserLight_SecondaryActivity);
+ }
+
+ // Run the default commands.