Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Do not concatenate text displayed with setText. Use resource string with placeholders.

//in xml
<string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>

//using
getString(R.string.welcome_message, "Test", 0);

//the result will be
"Hello Test! you have 0 new messages"
 
PREVIOUS NEXT
Tagged: #Do #concatenate #text #displayed #Use #resource #string
ADD COMMENT
Topic
Name
3+7 =