Util, a function that is often used in development.Create a java class.
I'm using it as a static function.
This Util.I need to refer to the contents of strings.xml in the java class.
I don't know how to do it
Is there a way to access resources in a regular class (not an activity)?
Thank you
android
The context is required to access the resource. Therefore, you can receive context as a parameter in the method and process it.
public static void test (Context) {
//do some thing
}
© 2024 OneMinuteCode. All rights reserved.