Skip to content Skip to sidebar Skip to footer

Android [string Array] Cannot Be Resolved Or Is Not A Field

I'm getting an error about a string array (located in strings.xml) not being able to be resolved. I've done everything the internet says: Restarted Eclipse Deleted my R.java file

Solution 1:

Just try out this way :

getResources().getString(R.array.app_categories_list);

Instead of R.string use R.array you will get your arraylist.

Solution 2:

Don't put your string arrays in strings.xml You must create a new file called arrays.xml and place them there. And when calling you need R.arrays.myarray, not R.strings.MyArray

Solution 3:

After cleaning your project try restarting the adb server by running adb kill-server and adb start-server from the command line

Solution 4:

a solution may be to create the R manually:

just hover over the error in the activity file where the problem was and then manually create it, which will cause R to generate the string array you created in strings.xml

Post a Comment for "Android [string Array] Cannot Be Resolved Or Is Not A Field"