Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:47:05+00:00 2026-06-15T12:47:05+00:00

Android styles and themes always seem to make my head spin. I wanted to

  • 0

Android styles and themes always seem to make my head spin. I wanted to use the Holo UI across different versions of Android for my app. So I decided to extract the necessary resources by browsing the source.

I came across the following in android-15\data\res\values\themes.xml and I’m confused as to what exactly is being ‘inherited’ and from where:

<style name="Theme.Holo.Light" parent="Theme.Light">
    ...
    ...
</style>

The Android API Guide says :

If you want to inherit from styles that you’ve defined yourself, you
do not have to use the parent attribute. Instead, just prefix the name
of the style you want to inherit to the name of your new style,
separated by a period.

But from the code above, it seems like Theme.Holo.Light is inheriting from Theme.Holo and from Theme.Light.

How does that work, or what am I not reading properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:47:07+00:00Added an answer on June 15, 2026 at 12:47 pm

    I’ve been wondering about this as well, so I wrote a simple test app to try it. Resources file looks like this:

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>
    
    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
    
    <style name="AppTheme.TestTheme" parent="android:Theme.Light">
    
    </style>
    

    So I apply AppTheme.TestTheme to the activity in the manifest file. AppTheme makes the window full-screen & not have a title bar. Theme.Light makes the window background light instead of the default dark. When the parent="android:Theme.Light" attribute is specified, the window is white and not fullscreen — this means that the parent="..." attribute takes precedence over the name prefix, and the hierarchy appears to be TestTheme <- Theme.Light (light) <- Theme (dark).

    With parent=”android:Theme.Light” removed, the screen is dark and fullscreen, so the TestTheme <- AppTheme (fullscreen) <- AppBaseTheme <- Theme (dark) hierarchy is in place.

    When parent="..." is specified, it makes no difference when I remove the prefix or not. So parent="..." seems to take definitely precedence. AppTheme.TestTheme does not inherit from both parents at once.

    Now, looking at the default themes.xml, it seems that Theme.Holo.Light inherits from Theme.Light, and then all of the Holo stuff is specified manually in its description. So they named it Theme.Holo.Light not because it inherits from Holo, but because they wanted a name that describes it as ‘the light version of Holo’. And because they wanted to be $@&!ing confusing.

    This was tested on Gingerbread 2.3.3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know how to create and apply styles and themes thanks to http://developer.android.com/guide/topics/ui/themes.html .
I'm trying to use a transparent background for my android app as stated here:
I'm switching my old Dialogs to DialogFragment, but the themes and styles don't seem
While looking through the built in Android themes/styles I noticed references to textColorPrimary, textColorSecondary
I have an Android Library Project that contains several styles/themes defined in its styles.xml
<style name=Theme.RateItTheme parent=@android:style/Theme.Holo.Light> <item name=android:actionBarStyle>@style/MyActionBar</item> <item name=android:titleTextStyle>@style/MyActionBar.Text</item> </style> <style name=MyActionBar parent=@android:style/Widget.Holo.Light.ActionBar> <item name=android:background>#2E495E</item> </style>
I still not understanding the parent role in the android styles I have put
I keep getting an error saying that @android:style/Widget.Holo.Light.Button.Borderless is not public and so can't
I am trying to read attribute values from themes and styles which were designed
I'm trying to create a theme for my first Android app, and it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.