In the Android application you have to translate the xml string. How do I do this in the java code?
In this code, for example:
Toast.makeText(getApplicationContext(), "Carregando o aplicativo", Toast.LENGTH_SHORT).show();
In the Android application you have to translate the xml string. How do I do this in the java code?
In this code, for example:
Toast.makeText(getApplicationContext(), "Carregando o aplicativo", Toast.LENGTH_SHORT).show();
You have the file res / values / strings.xml , correct?
Then you should create a new values directory for the language you want to use in the APP, for example:
And in Toast, instead of putting the text right there, you'd pull R.string.charging for example
It will work according to the default language of the user's device, if the device is set to French, Java will automatically fetch the texts in res / values-fr / strings.xml