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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:00:05+00:00 2026-06-09T04:00:05+00:00

Are all IDs in R permanent? Recently I’ve made a game and use IDs

  • 0

Are all IDs in R permanent? Recently I’ve made a game and use IDs of sound tracks to save to SharedPreferences. I’m wondering if those IDs (of the same files) will be changed at next build? Could you point me to documentation?

  • 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-09T04:00:07+00:00Added an answer on June 9, 2026 at 4:00 am

    They are changed every time the resources are changed. You should not rely on hardcoded values (such as saving them in SharedPreferences).

    There seems to be no real documentation saying this (see the docs on resources), however you can test this yourself by recording the int value of R.id.hello_world (for example), then add a whole bunch of strings before and after it in the XML files, then rebuild it. The int value will be completely different.

    Edit: I did find a bit of documentation you may want to read. It states: “you should never need to look there to discover a resource ID“; even though, in your case, you are not looking into this file, you are using a value directly from it.

    Additionally, there is this answer which talks about how the IDs are generated, and it details that each generated ID has an order to it (package name, type name, resource name), but that these are generated arbitrarily. And this: “Note that aapt by default makes no attempt to keep these identifiers the same between builds.“

    You may also want to read through this slideshow for more details on AAPT and the Android Resource generation process.

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

Sidebar

Related Questions

I want to retrieve all ids within a certain timespan. The timestamps however, are
Problem Given the following two tables, I'd like to select all Ids for Posts
How can I get all IMDB ids from a page? For example, I want
Possible Duplicate: How to get all of the IDs with jQuery? How can i
On my setup, the ids of all entries will be fetched (e.g. assigned to
all I want to show hide some ids using jQuery. My html code is
I have a list of parent/child IDs and would like to get all child
In one class there is a list with all friends and their IDs. Now
I want to get all ids from a collection of items, how can I
How do I select all Ids in any entity query as a List? Let

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.