안드로이드

[Android] Formatting strings

SojuMan 2012. 1. 17. 15:29
TextView 내의 텍스트에 변수 값 넣기
http://developer.android.com/guide/topics/resources/string-resource.html

<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);