boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
// Create a red foreground color span. The deprecated `getResources().getColor` must be used until the minimum API >= 23.
boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
// Create a red foreground color span. The deprecated `getResources().getColor` must be used until the minimum API >= 23.
// Create a blue foreground color span.
ForegroundColorSpan blueColorSpan;
// Set the blue color span according to the theme. The deprecated `getResources().getColor` must be used until the minimum API >= 23.
if (darkTheme) {
// Create a blue foreground color span.
ForegroundColorSpan blueColorSpan;
// Set the blue color span according to the theme. The deprecated `getResources().getColor` must be used until the minimum API >= 23.
if (darkTheme) {