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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:03:24+00:00 2026-06-12T12:03:24+00:00

I have an Adnroid library project that defines XML resource. Let’s use a selector

  • 0

I have an Adnroid library project that defines XML resource.

Let’s use a selector drawable as an example (but I have problems with strings, styles, etc).

LibProject/res/drawable/button_selector.xml … defines a selector

LibProject/res/layout/view.xml …. uses the selector, with no problems

 `<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/sign_up_fly_buttons"
        android:background="@drawable/button_selector"/>`

Then I want to refer to it in a layout in my App

AppProject/res/layout/view.xml …

`<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/sign_up_fly_buttons"
        android:background="@drawable/button_selector"/>`

But in the App it won’t compile or let me reference it.
I’ve tried various namespace incantations to try and refer to it with no luck…

Any ideas?

Addition:
I have read that the full-form for such references is:
@[packagename:]type/id
and if you leave out the package name then the package where this resource file is used.

This an example would be:
@com.mylibrary:drawable/button_selector

But it doesn’t work for me! There must be something wrong with my library setup/import?

My library is in a separate Eclipse Android project, marked as a Library project, and is referenced from my app as a “Dependent Project” and code is built and links in fine.

  • 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-12T12:03:25+00:00Added an answer on June 12, 2026 at 12:03 pm

    OK, found the problem!

    In Eclipse, in my Project Properties -> Java Build Path -> “Projects” ‘tab’ I had the library project added.

    BUT, I also had to add it to Project Properties -> Android -> Library area as Library Project.

    I had done this for others, but had forgotten to do it here.

    Thanks to all who tried to figure out my mistake.

    Now the resources are merged in correctly and I can refer to them using the “short-form” format without the package name.

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

Sidebar

Related Questions

I have an Android Library Project that contains several styles/themes defined in its styles.xml
I have an Android project that depends on an android library (apklib) project. The
I have an Android app that references to a library Android project. That setup
I have an Android library project that has been working for me pretty well,
I have an Android Project(A) that's my main application, it references an Android library
I have an Android project that uses a library project (all of which I
I'm making a paid/free version of my app so have a 'Library Project' that
Okay I have a project that is using the android-rss library (org.mcsoxford.rss). I created
I have an Android library project (Properties > Android > IsLibrary checked) that pulls
I have a library-only Android eclipse project (no main class, only library classes) that

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.