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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:24:30+00:00 2026-05-28T04:24:30+00:00

I know now, that if I need to get a recource in some static

  • 0

I know now, that if I need to get a recource in some static function, I have to pass context or recources of the context there somehow – by parameter or through a static variable. But why is it neccessary? The id’s of the resources are reachable in static surroundings, for example R.string.some_my_stuff. If I want a system resource, it is also visible there through Resources.getSystem().getString(android.string.some_common_stuff). But why can’t I do something similar to get an application resource? The resource files are the usual static part of the sources. Resources are static and belong to application. The classes of application belong to it in the same way and I can access their static parts in a static way.

Why can’t I use resources in all the application in same static way, which would be the most natural, but have to access them through instance instead?

I am afraid, I do not understand something very important.

Please, don’t repeat that I can’t do it. I know it, on my honour. Please, explain why, or show me the way… Only that will cure me from my sadness 🙂 Thank you.

  • 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-28T04:24:31+00:00Added an answer on May 28, 2026 at 4:24 am

    The resource IDs are unique per application, they are not unique over all application (including the Android system). E.g. there may be two different string in different applications which have the same ID, say 42.
    Therefore yon may access only one application statically (every programmer must agree which one that is, its the Android system (there no choice, its the only one always installed)). For all the other application you must be able to tell the system which application’s resources you want to access. You do this using the context.

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

Sidebar

Related Questions

Now that I know C++ I want to get into desktop application that have
So I know now that the debug assemblies have been intentionally left out of
Now that I know I can no longer communicate with Twitter mashups out there,
Does anyone know if there's a windows Python executable creator program available now that
Now I know that bigint is 2^64; that is, more atoms than there are
Language Integrated Query. Now I know that the acronyms are. I have seen C#
Other than that I don't know if I can reproduce it now that it's
Now that LINQ to SQL is a little more mature, I'd like to know
Now that Google Earth has been released for Android 2.1, does anyone know what,
I am storing objects in a buffer. Now I know that I cannot make

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.