본문 바로가기

dev/android

@string resource에 parsing 없이 문자열 넣기

반응형

출처 : http://stackoverflow.com/questions/4207068/add-more-than-one-string-to-a-textview



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


Resources res = getResources();
String text = String.format(res.getString(R.string.welcome_messages), username, mailCount);


쓸일이 있을까 싶지만...