7

Maybe this is a silly question but is there a difference,besides the obvious,between android:text="@string/...." and android:text="..."?.I'm thinking that maybe the text that appears on the screen has the option for styling when using @string.Which one is best to use in general or it really doesn't matter?

2 Answers 2

4

When you're using android:text="@string/" the app is going to find the value of the string in the ressources file, with this technique you can manage multilanguage app, with a "strings"'s file by language.

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

Comments

0

Choice Matters, if your app has a lot of text in it, supporting a different language would be easier if you used @string, you would not have to scramble through every xml file to add text in the other language for every piece of text, simply go to strings resource and change there.

But then again, when checking UI for errors after work is done, it might make life harder (or work boring) as fixing a typo would require you to go to the xml file that the erroneous text is located, look up the name of string and then go to Strings to correct (unless you were very organised and named things well in your Strings such that you know which text belongs where)

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.