I have a call
Resources resources = Resources.getSystem(); String[] networkFiles = resources.getStringArray(R.array.xmlNetworkFiles);
and I know that this resource array exists (since I can reference it with an automatically generated R file), but it keeps throwing ResourceNotFoundException.
ResourceNotFoundException
What could be causing this and what can I do to fix it?
I used similar code elsewhere to retrieve an array from int, but in my unit tests it always fails.
This is because it Resources.getSystem()returns an invalid Resources object. From the documentation:
Resources.getSystem()
, ( ) ( ..).
, R.array.xmlNetworkFiles - , , .
R.array.xmlNetworkFiles
getResource() ( Activity) getContext().getResources() ( View).
getResource()
getContext().getResources()
Resources resources = getResources(); String[] networkFiles = resources.getStringArray(R.array.xmlNetworkFiles);
, , .
Source: https://habr.com/ru/post/1790831/More articles:Как определить использование стека потоков из Python? - pythonTriangulating rectified image points in multiple views - image-processingResolving local HTML storage replacement - sqlImplement vba macro in excel using .net - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1790830/uiviewcontroller-subclass-to-support-both-nib-loading-and-non&usg=ALkJrhgC64CwYNEi7Edb8CD6GbwzFGeA7gКак получить идентификатор пользователя Facebook во время деавторизации - facebook-c#-sdk.NET CMS with user authentication - authenticationThe advantage of using "specific" ORM: s in PHP? - phpChange background in iOS - iosQuotations in html tag attribute problem value - htmlAll Articles