“Java String Android” Kode Jawaban

Java String Android

Let's say you want to display this and also translate it:
Hello, [display name]! You have [display an other variable] new messages.

Put your string in the strings.xml file with this %n$s as fields:
<string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>

Get and set in your class in this way:
Resources res = getResources(); //previously done
String text = String.format(res.getString(R.string.welcome_messages), username, mailCount);
PizzaSolver

Java String Android


<string name="title">Title Message</string>
<string name="sub_title">Sub Title Message</string>

Clever Capybara

Jawaban yang mirip dengan “Java String Android”

Pertanyaan yang mirip dengan “Java String Android”

Lebih banyak jawaban terkait untuk “Java String Android” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya