문제

I have two resources file in res/values directory: string.xml and names.xml

how can I retreive all resources from names.xml only

the method

Field[] x=R.string.class.getFields();

retrieves resources from both files.

how can this be acheived

thanks

도움이 되었습니까?

해결책

I am sorry, but that is not possible. It does not matter that you have your strings split between multiple named resource files -- Android combines them all when it compiles your project.

You are welcome to use prefixes or something to identify one set of strings from another. I do that with the support code for the Android Parcel Project, to allow reusable components to each define strings without one overwriting the strings of another.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top