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 3699772
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:08:37+00:00 2026-05-19T05:08:37+00:00

Hi I’m new to the whole xml type stuff. I’ve built a ROM called

  • 0

Hi I’m new to the whole xml type stuff. I’ve built a ROM called Sourcery for the D1 and I’m looking to write an xml that I want to point at from the drawable.xml in the values folder in the framework-res.apk that part is easy I already have it pointed at an xml I named newbackgrounds.xml and I’ve created it in the values folder.

I want to use it for backgrounds and my idea is to have a selector where it sets an image as a background but if the image is not there to have it be black (#ffffffff). The image is kept in the drawable folder of the framework-res.apk and is named background_dark.jpg

Something kind of like this (again i’m new so pardon any errors here this is just my basic idea)

<?xml version="1.0" encoding="UTF-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item "@drawable/background_dark.jpg"="true" 
android:screen_background_dark="@drawable/background_dark.jpg" />
    <item "@drawable/background_dark.jpg"="false" 
android:screen_background_dark="#ffffffff" />
</selector>

That however didn’t work so what changes need to be made?
Thank you for any help or alternatives it is much appreciated

  • 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-05-19T05:08:38+00:00Added an answer on May 19, 2026 at 5:08 am

    Your XML is not valid XML, this isn’t what selectors are for, and Android’s resource system does not work this way. 🙂

    XML attributes are declared as namespace:attributeName="value". You cannot use a string in place of an attribute name.

    Selectors choose a drawable based on predefined states, such as pressed, focused, window focused, enabled, etc. They’re meant to choose at runtime from a set of drawables known at build time. You’re trying to use them to detect whether or not a resource exists, which doesn’t make sense within the Android resource system.

    Drawable resource IDs are generated by aapt from resources that exist on the filesystem as image files or XML. If an XML resource references "@drawable/background_dark" and it doesn’t exist, aapt will fail to build your resources entirely. It’s the same as if you tried to read a variable in Java before declaring it. The file existing is the declaration step.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I've got a string that has curly quotes in it. I'd like to replace
I'm looking for suggestions for debugging... If you view this site in Firefox or
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.