I am building a sample application based on latest version of Android OS..As per instructions given here I am trying to give holo:light theme to only one button in my application. How do i do it ? I have created a myStyles.xml in res/values folder but I am not able to find property to apply holo-light theme.
This is what i have in myStyles.xml file
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="mybutton" parent="android:Theme.Holo.Light">
<item name="android:background">@android:color/holo_orange_light</item>
<item name="android:textColor">@android:color/holo_blue_dark</item>
</style>
</resources>
this is i have in my activity.
<Button
android:id="@+id/button1"
style="@style/mybutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="lol" />
I can confirm that backgroundcolor and textcolor are getting applied…(done this for testing purpose).
Currently, If i add android:theme=”@android:style/Theme.Holo.Light” to AndroidManifest.xml, holo light theme is applied to entire application. However, I want this theme to be applied for only few controls ( in this case a single button control).
Thus, what you are asking for is not possible. That being said, it seems odd that you would want to do this anyway. I suggest applying the holo theme to your entire app, and then customizing your
Buttons only if you really need to. This is probably what the user will expect from your application.