android.content.res.Resources$NotFoundException: String array resource ID #0x7f070002

后端 未结 6 1064
不知归路
不知归路 2020-12-14 23:33

I\'m having problem getting a string array for strings.xml .

The error is:

android.content.res.Resources$NotFoundException: String array resource ID         


        
6条回答
  •  醉话见心
    2020-12-15 00:13

    Make sure you don't have variants of the values resources, with the string array defined only for a subset of the variants. For example:

    values-v21/strings.xml - defined
    values/strings.xml - not defined
    

    If the resource is present in at least one variant, you get the entry in R and can refer to it in code, but the runtime resource file variant does not necessarily have the resource.

提交回复
热议问题