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