Hy!
I have in my /values/strings.xml:
<resources>
<string name="error418">Bad Request</string>
<string name="error404">Not Found</string>
......
</resources>
the same in /values-de/strings.xml
Now i want to get the error messages by the string “error418”.
I only found context.getString(int …).
How to get the error message by code?
If you want to get resource id dynamically, according to error code for example, you need to use getIdentifier()
e.g.