2
votes

I have a username TextView below which there is EditText and the same for password.I need just the EditText to be changed to Holo theme for respective devices.. I've tried setting parent in style.xml as

parent="@android:style/Theme.Holo.

parent="@android:style/Widget.Holo.Light.EditText"

but of no use..Anyone has an answer??

Hi i got the answer. the cause was activity which calls this dialog had theme android:theme="@android:style/Theme.Translucent.NoTitleBar" in manifest ..i removed and added in oncreate and there comes holo for editText!!!!

4
Can you post your styles.xml and manifest?James McCracken
In xml <EditText style="@style/EditTheme"/> and in style.xml(i.e values-v13)i have <style name="EditTheme" parent="@android:style/Theme.DeviceDefault"> <item name="android:background">@android:style/TextAppearance.DeviceDefault.Widget.EditText</item> </style>user1340801
I had the same issue because of using android:theme="@android:style/Theme.Translucent.NoTitleBar" for my dialog activity theme and resolved it by changing to android:theme="@Theme.Holo.Dialog.NoActionBar".mbonness
Same here. I replaced in the AndroidManifest.xml the style android:theme="@android:style/Theme.NoTitleBar.Fullscreen" with android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" and Holo was back on my EditText. Please accept your answer as the right solution. Thx!Dirk

4 Answers

10
votes

use holoeverywhere lib

OR

you can generate the edittext Holo style using android-holo-colors download the zip.then set the edittext background

2
votes

I had more or less the same problem. Here is my solution. =)

<style name="AppTheme" parent="android:Theme.Holo.Light">

            <item name="android:editTextStyle">@style/AppTheme.EditTextStyle</item>
            <item name="android:editTextBackground">@drawable/apptheme_edit_text_holo_dark</item>
        </style>

    <style name="AppTheme.EditTextStyle"  parent="@android:style/Widget.Holo.EditText">
        <item name="android:textSize">@dimen/etforlogin</item>
        <item name="android:singleLine">true</item>
        <item name="android:ellipsize">end</item>
        <item name="android:typeface">monospace</item>
    </style>
0
votes

Add the style attribute in your EditText in your XML

<EditText
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    style="@android:style/Widget.Holo.EditText"/>
0
votes

According to the Android developer site we are supposed to use the following theme for Activities that are displayed as a dialog if the Holo theme is desired:

<activity android:theme="@android:style/Theme.Holo.Dialog" >

http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout