I have a Dashboard.java file where I use strings.xml parsed in R.java auto generated file.
When I try to do:
public String BASE_URL = R.string.BASE_URL;
Naturally will tell Cannot convert from int to String.
But that's what will be chosen from string.xml for the translation.
Is there a way around this?
Thanks
Use This
String BASE_URL = getResources().getString(R.string.BASE_URL);
or you can copy from the code below:
getResources().getString(R.string.BASE_URL);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With