Good day, I would like to know or ask for help. I'm having a hard time getting the string value from my app's string.xml. I am accessing it through an Arraylist (in a separate java file. arraylist is not inside the activity or fragment).
I tried both String.valueOf and Integer.toString (refer below ss):
but the results for the both are the same(please refer below ss):
the left items are supposed to be a string value from my string.xml but I don't know how and why. I also tried Resources.getString but it crashes the app.
Do you have any idea that I can try in solving this problem? Thank you, it will be very much appreciated and sorry for the time answering my question.
EDIT: Here's the code(please see ss below) and I also tried the getString() suggestion.

sorry I'm really not good in development but I'm willing to listen and learn.


Add a
contextargument to your function:Notice that I changed your ArrayList variable name to use Java's camelCase standard (
CategoryObjects--> `categoryObjects).Then you just need to pass a Context object to it.
From an Activity:
From a Fragment:
In the future, please paste your code as text. It's actually a lot easier than taking a screenshot.