1
Hello, inside the Mainactivity XML in Android Studio I can use @string/STRING I would like to know how I would reference a string I have inside the strings.xml in the res folder of Android Studio.
Example strings.xml
<string name="beer">Beer</string>
Example strings(en)
<string name="beer">Cerveja</string>
In the code I wanted to reference this:
@Override
public void onClick(View v) {
Toast toast;
switch (v.getId()){
case R.id.ce : toast = Toast.makeText(getApplicationContext(), QUERIA_REFERENCIAR_AQUI ,Toast.LENGTH_SHORT); toast.show(); break;
[...]
default : break;
}
So that there is translation in my app even in these messages, because in the layout, works well. Thank you!
Would it be possible?
Thank you very much!
– Vinicius Petrachin