1
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomTheme" parent="android:Theme"> 
<item name="android:textSize">20sp</item>
<item name="android:textColor">#FFFFFF</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:typeface">serif</item>
<item name="android:background">@drawable/blueborder</item>
<item name="android:button">@drawable/rounded_edittext</item>
<item name="android:textAppearance">@android:drawable/alert_light_frame</item>
<item name="android:textColorHighlight">@android:color/black</item>
</style>

<style name="DialogTheme" parent="@android:style/Theme.Dialog">
</style>  

<style name="ButtonStyle" parent="CustomTheme">
</style>  

<style name="JobViewHeader" parent="@android:style/TextAppearance.Small">
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
</style>

</resources>

This is my code, I have done style and theme in XML. I have applied background resource (ie) btn.setBackgroundResource(R.drawable.rounded_edittext); in Java. It has been changed especially shapes. I do not understand what is wrong here.

Same, how should I apply theme in XML file? If I called once it should apply to all the components entirely, Android.

halfer
  • 19,824
  • 17
  • 99
  • 186
Achiever
  • 1,626
  • 10
  • 30
  • 54

1 Answers1

0

In, your application's AndroidManifest.xml, add a theme attribute android:theme="@style/CustomTheme" to <application> tag.

S.D.
  • 29,290
  • 3
  • 79
  • 130
  • // I have already added. No changes i have seen :-( – Achiever Aug 31 '12 at 05:39
  • Yeah i have added after you said @wingman but no changes. I guess, have to call button style in resources. I mean, in my above code, i have created button style but i dint call it. I have no idea , whether i am right or wrong . – Achiever Aug 31 '12 at 05:46