android - Background of MenuItem won't change -



android - Background of MenuItem won't change -

i posted similar question regarding code compiling managed running. however, code doesn't alter default white background darker color. here code:

<?xml version="1.0" encoding="utf-8"?> <resources> <style name="theme"> <item name="@android:panelfullbackground">@android:color/background_dark</item> <item name="@android:panelcolorbackground">@android:color/background_dark </item> <item name="@android:panelbackground">@android:color/background_dark</item> </style> </resources>

i'm applying theme here:

<menu xmlns:android="http://schemas.android.com/apk/res/android" style="@style/theme"> <item android:id="@+id/add"/>...... </menu>

edit: here output logcat

01-10 05:47:08.434: e/androidruntime(30489): fatal exception: main 01-10 05:47:08.434: e/androidruntime(30489): android.content.res.resources$notfoundexception: resource id #0x0 01-10 05:47:08.434: e/androidruntime(30489): @ android.content.res.resources.getvalue(resources.java:901) 01-10 05:47:08.434: e/androidruntime(30489): @ android.content.res.resources.getdrawable(resources.java:589) 01-10 05:47:08.434: e/androidruntime(30489): @ com.android.internal.policy.impl.phonewindow.openpanel(phonewindow.java:500) 01-10 05:47:08.434: e/androidruntime(30489): @ com.android.internal.policy.impl.phonewindow.onkeyuppanel(phonewindow.java:703) 01-10 05:47:08.434: e/androidruntime(30489): @ com.android.internal.policy.impl.phonewindow.onkeyup(phonewindow.java:1475) 01-10 05:47:08.434: e/androidruntime(30489): @ com.android.internal.policy.impl.phonewindow$decorview.dispatchkeyevent(phonewindow.java:1845) 01-10 05:47:08.434: e/androidruntime(30489): @ android.view.viewroot.deliverkeyeventtoviewhierarchy(viewroot.java:2758) 01-10 05:47:08.434: e/androidruntime(30489): @ android.view.viewroot.handlefinishedevent(viewroot.java:2730) 01-10 05:47:08.434: e/androidruntime(30489): @ android.view.viewroot.handlemessage(viewroot.java:1999) 01-10 05:47:08.434: e/androidruntime(30489): @ android.os.handler.dispatchmessage(handler.java:99) 01-10 05:47:08.434: e/androidruntime(30489): @ android.os.looper.loop(looper.java:150) 01-10 05:47:08.434: e/androidruntime(30489): @ android.app.activitythread.main(activitythread.java:4385) 01-10 05:47:08.434: e/androidruntime(30489): @ java.lang.reflect.method.invokenative(native method) 01-10 05:47:08.434: e/androidruntime(30489): @ java.lang.reflect.method.invoke(method.java:507) 01-10 05:47:08.434: e/androidruntime(30489): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:849) 01-10 05:47:08.434: e/androidruntime(30489): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:607) 01-10 05:47:08.434: e/androidruntime(30489): @ dalvik.system.nativestart.main(native method)

instead of setting theme menuitem, seek setting theme application tag in androidmanifest.xml this:

... <application android:theme="@style/theme"> ...

add parent in style when defining "theme" in styles.xml this:

edit: working me seek alter colors

<resources> <style name="theme" parent="android:theme"> <item name="@android:panelfullbackground">#9c133c</item> <item name="@android:panelcolorbackground">#9bcd08</item> <item name="@android:panelbackground">#9c133c</item> </style> </resources>

android background menuitem

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -