This is the source to Locale section that's in the Settings
https://android.googlesource.com/plat开发者_如何学编程form/packages/apps/Settings/+/gingerbread-release/src/com/android/settings/LocalePicker.javaDoes anyone know what is the full package name for the R
class? Oddly enough its not in the import list NOR is it in the com / android / settings package.
I want R.array.special_locale_codes
for my own needs.
Getting R.array.special_locale_codes
is irrelevant if there isn't any res/values/nameofxmlcontainingarray.xml
There must be xml file
inside res/values/nameofxmlcontainingarray.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="special_locale_codes">
<item>first</item>
<item>second</item>
<item>third</item>
<item>fourth</item>
<item>fifth</item>
</array>
</resources>
R.array.special_locale_codes
is generated file at the built time. Manually editing R.java is totally un-recommended.
R.java
contains resources which are defined inside your project which can be wired up with java code at built time
. Getting resources from project
can be done using R.id.componentname
FIX
:If your project do contains proper resources at defined structure then you may give a try to clean your project using rightclick project->clean project
精彩评论