I'm trying to make a string in the string.xml replace a field on the screen, but I've been searching and I'm not able to use it as a variable
string.xml
<string name="nome">%1$s</string>
class.java
Resources res = getResources();
String text = String.format(res.getString(R.string.nome), username);
layout.xml
<TextView
android:id="@+id/nome1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nome"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
Result: