How to reference a style in a custom theme

I have a login screen that is branded differently for different builds of my application. I need the background image to be different in the layout file for this screen, so I want to point to a different style for the top level container. I’m a bit at a loss at how to do this.

I have declared a styleable something like:

  • Android build failing with build.xml:479: SDK does not have any Build Tools installed
  • How does Dolphin web browser get notified when it's being uninstalled?
  • Android Studio says “cannot resolve symbol” but project compiles
  • Backup/restore sqlite db in android
  • How can I detect a click on the ActionBar title?
  • Determine addAction click for Android notifications
  • <resources>
        <declare-styleable name="ThemeBase">
           <attr name="loginPageContainerStyle" format="reference" />

    I have several different themes for the application, as such:

        <style name="ThemeBase" parent="android:style/Theme.Light" />
        <style name="ThemeOne" parent="ThemeBase">
           <item name="loginPageContainerStyle">@style/loginPageContainerThemeOne</item>
        <style name="ThemeTwo" parent="ThemeBase">
           <item name="loginPageContainerStyle">@style/loginPageContainerThemeTwo</item>

    And I have defined the following styles:

        <style name="loginPageContainerThemeOne">
            <item name="android:background">@drawable/background_theme_one</item>
        <style name="loginPageContainerThemeTwo">
            <item name="android:background">@drawable/background_theme_two</item>

    And finally a login.xml file something like:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android=""
        style= [ ? WHAT GOES HERE ? ]
        [ LAYOUT STUFF ... ]

    Am I doing anything wrong? Can this be done this way?

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.