Sunday 15 September 2013

How can I change the color of the Android Action Bar? -


I'm trying to change the color of your Android ActionBar, but my app each time ended with an error . I have tried all other suggestions and improvements in other positions, but they do not work for me. Also - minSdkVersion 19

Error:

  03-17 Nvmber: 25: 56.884 11,999-11,999 / ca.holdfastonline.menu_test_02 E / AndroidRuntime: Fatal Exception: the main process : ca.holdfastonline.menu_test_02, PID: 11999 java.lang.RuntimeException: java.lang.IllegalStateException :: activity to start need to use a Theme.AppCompat ComponentInfo {ca.holdfastonline.menu_test_02 / ca.holdfastonline.menu_test_02 unable .MainActivity} theme (or descent with this activity) on android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2292)  

I Styles.xml

  & lt; Resources & gt; & Lt; Style name = "question theme" guardian = "@ style / theme. AppCompat" & gt; & Lt ;! - Any customization for your app running on devices with themes. Here - & gt; & Lt; / Style & gt; & Lt ;! - Topics applicable to the application or activity - & gt; & Lt; Style name = "custom actionbeartheme" parent = "@ Android: Style / Theme. Hollow Light. Dark Actionbeer" & gt; & Lt; Item name = "Android: Actionbarstyle" & gt; @ Style / myactionbar & lt; / Item & gt; & Lt; / Style & gt; & Lt ;! - Action style - & gt; & Lt; Style name = "MyActionBar" Origin = "@Android: Style / Widget.Hello Light.Actionbar.Solid Andres" & gt; & Lt; Item name = "Android: Background" & gt; # 2980b9 & lt; / Item & gt; & Lt; / Style & gt; & Lt; / Resources & gt;  

My AndroidManifest.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Xmlns Reveal: Android = "http://schemas.android.com/apk/res/android" package = "ca.holdfastonline.menu_test_02" & gt; & Lt; Application Android: allowBackup = "true" android: icon = "@ Mipmap / ic_launcher" android: label = "@ string / app_name" android: theme = "@ style / QueryTheme" & gt; & Lt; Activity Android: Name = "Main Activity" Android: label = "@ string / app_name" Android: Theme = "@ Style / CustomActionBarame" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;  

Thanks.

  java.lang IllegalStateException: you theme with this activity. The app comet theme (or lineage) must be used.  

You only have one activity using this @ style / custom action theme . You have inherited the definition from Theme.Holo.Light.DarkActionBar . This is not a AppCompat topic. Change theme.holo.light.click actionbar to Theme.AppCompat.Light.DarkActionBar .


No comments:

Post a Comment