0

I have created a new xml file with the name "constant.xml" in the folder values.

How can I access the values?

The file is construced like the strings xml. For this I need only

 getString(R.string.STRING_NAME).

But R.constant.STRING_NAME is not avaiable.

0

1 Answer 1

2

You may access string resources the same way as you would if they were located in the strings.xml file; location does not affect your ability to call them. In your case, you can access your string resource by simply using getString(R.string.STRING_NAME), as you would with a standard string located in the strings.xml file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.