Hi everyone, am new to Java. During development I needed to use string resources. I can fetch them from strings.xml for the layout xml file and for the MainActivity.java file (using getString(R.string.name)). But I can't get to use them in an external class file (which is being used to handle all the functions of the MainActivity file).
I have gone through StackOverflow forum and tried many answers but in vain. I tried using:
1. Resources.getSystem().getString(R.string.name)
2. getResources.getString(R.string.name)
I have a orderProcessing button in mainActivity.java which gets processed in orderSummary function in mathCalculator.java. Everything works out fine when I use hardcoded strings. I just can't get to use the string resources from strings.xml to reference them.
Please help out in this regard. Many thanks