So I'm going to make my application Multilingual and making different String.xml's for different languages. I'm also changing my texts, such as
String message = "Calling " + name;
Context context = getApplicationContext();
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, message, duration);
toast.show();
to
String message = toastCalling + name;
(From strings.xml)
<string name="toastCalling">Calling</string>
I'm facing a problem, that it apparently is an INT, and either cannot be resolved, or changes the value of toastCalling (Calling) to "278172" (Random Numbers)
Is there a way to get the ACTUAL value of R.String.toastCalling (Calling)
I have tried:
String whatever = getResources().getString(R.string.toastCalling);
But I don't think that's practical.
Thanks in advance!
getResources()is going to automatically point to the correct resource bundle for the current Locale.