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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:38:51+00:00 2026-05-13T22:38:51+00:00

Yes, I know you need a unique resource id when calling the version of

  • 0

Yes, I know you need a unique resource id when calling the version of these functions that requires a key, but I cannot for the life of me figure out how to create a resource id that can be used in this way. A final variable in my class wont work and neither will a hard coded value. Both threw an IllegalArgumentException. So what gives, how do you use these methods?

Spara

  • 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-13T22:38:51+00:00Added an answer on May 13, 2026 at 10:38 pm

    From the Javadoc:

    The specified key should be an id declared in the resources of the application to ensure it is unique.

    So you can’t just make up values and place them in a local variable.

    Every resource you create whether it’s a string (R.string.*), or a layout (R.layout.*) or an individual View (R.id.*) can have an ID. This is something you must be doing already.

    If you do need to store multiple objects against a single View, then you need to use the R.id variant as a key, like someView.setKey(R.id.my_key_1, someObject).

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

Sidebar

Ask A Question

Stats

  • Questions 539k
  • Answers 539k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer DECLARE @sqlCommand NVARCHAR(1000) DECLARE @count INT DECLARE @city VARCHAR(75) SET… May 17, 2026 at 2:23 am
  • Editorial Team
    Editorial Team added an answer To give a more thorough answer, look a little deeper… May 17, 2026 at 2:23 am
  • Editorial Team
    Editorial Team added an answer The article referenced by Naveen has an important remark, that… May 17, 2026 at 2:23 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Yes, I know that in ASP.NET MVC you have to use ViewModels. But I'm
I have an a aspx page, but all content is generated by hands(yes I
I need to know if a point is inside at lease one of the
I want to fill a map with class name and method, a unique identifier
One of the ncie things about PHP is that if you do an include/require
We have an ASP.NET form with the following doctype:- We need to add autocomplete=off
Basically I have created two MATLAB functions which involve some basic signal processing and
I have a two part problem that needs fixing. I'll try my best to
I'm looking to build a cross-site bookmarklet that gets a highlighted word, passes it
Im trying to do a regex where I can find all html tags, but

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.