I've tried many ways for "getString" in the ViewModel , as I've succeeded to getString at the MainActivity.class which the code is just getString(R.string.value) like that ... but I am clueless for getString in ViewModel , I have tried many ways such as using context, Resources.getResouces().getString(R.string.value) etc , please help me and thanks in advance
private int API_KEY = R.string.API_KEY;
Log.d(TAG, "getData: " + context.getString(API_KEY));
I expect the results is the string from strings.xml that could be get from the int of R.string.API_KEY