Search
 
SCRIPT & CODE EXAMPLE
 

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"
Comment

PREVIOUS NEXT
Code Example
Java :: how to change color of progress bar in android 
Java :: start new activity android 
Java :: java print 2d char array 
Java :: default method in java 
Java :: Validation failed for query for method public abstract java.util.List 
Java :: try block in java 
Java :: Islands count leetcode 
Java :: string to string array java 
Java :: James Gosling 
Java :: java camel case 
Java :: java regex 10 digit number 
Java :: java 8 datediff in days 
Java :: core java tutorial 
Java :: check if string is uuid 
Java :: java print 
Java :: check if sqlexception is duplicate entry java 
Java :: priority scheduling in java 
Java :: split number java 
Java :: how to initialize array in java 
Java :: How to find the prime factors of a number in Java? 
Java :: java sleep 1 second 
Java :: java arraylist deep copy 
Java :: fill two dimensional array row by row java 
Java :: java time difference 
Java :: create a list java 
Java :: java try and catch 
Java :: java string to uuid 
Java :: java replace character 
Java :: java class name to string 
Java :: java access attribute of object in arraylist 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =