When you install the custom theme setTheme() for some reason, only ColorPrimaryDark color ColorPrimaryDark . Here is the topic itself
<style name="Red" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <item name="android:colorPrimary">#ca3030</item> <item name="android:colorPrimaryDark" >#a42525</item> </style> I change the theme from my own ThemeUtils class ThemeUtils Here is the class itself.
package alphacorp.com.touristapp; import android.app.Activity; import android.content.Intent; public class ThemeUtils{ private static int sTheme; public final static int FIRE_BRICK = 0; public final static int DODGER_BLUE = 1; public static void changeToTheme(Activity activity, int theme) { sTheme = theme; activity.finish(); activity.startActivity(new Intent(activity, activity.getClass())); activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } public static void onActivityCreateSetTheme(Activity activity) { switch (sTheme) { default: activity.setTheme(R.style.AppTheme); break; case R.id.red: activity.setTheme(R.style.Red); break; case R.id.vk: activity.setTheme(R.style.Vk); break; case R.id.green: activity.setTheme(R.style.Green1); ;break; case R.id.pink1: activity.setTheme(R.style.Pink); ;break; case R.id.orange: activity.setTheme(R.style.Orange); ;break; case R.id.black: activity.setTheme(R.style.Black); case R.id.green2: activity.setTheme(R.style.Green2); case R.id.blue: activity.setTheme(R.style.Blue2); case R.id.pink2: activity.setTheme(R.style.Pink2); } } }
android:colorPrimaryrequires an API version of 21 or higher. On which version of Android do you watch? - Vadik