프로젝트를 만들면 일반적으로 app/res/values/strings.xml 이 생기는데요,
저는 현재 res 폴더와 같은 레벨 (?) 에, app/res_second 란 폴더를 만들고 싶습니다. 또 여기다 app/res_second/values/strings.xml 를 만들고 싶은데요.
이 똑같은 이름의 strings.xml 을 서로 활용하고 싶습니다.
예를 들어, (app/res/values/strings.xml 을 우선시 할 때)
// app/res/values/strings.xml
<resources>
<string name="app_name">StringTest</string>
</resources>
// app/res_second/values/strings.xml
<resources>
<string name="app_name">2222222</string>
<string name="X">X</string>
</resources>
이렇게 2개의 strings.xml 이 있다고 하면,
TextView tv = (TextView)findViewById(R.id.Hello);
tv.setText(R.string.app_name);
// --> StringTest 가 되어야 함!!
TextView tv = (TextView)findViewById(R.id.Hello);
tv.setText(R.string.X);
// --> X 가 되어야 함!!
이렇게요...
즉, res_second 가 아닌 그냥 res 폴더의 strings.xml 을 우선시한다고 해도, res 폴더에 없는 스트링이 나오면 res_second 폴더의 strings.xml 을 참조하게 할 수 있을까요??
추가적인 질문) 애초에 res 폴더와 같은 레벨로 리소스 관리폴더를 어떻게 만드나요??