android.content.res.Resources$NotFoundException: String array resource ID #0x7f070002
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.
I got this error because I used TextView.setText(int)
to set a number in the text. The problem is that Android thinks that the integer is a ressource id. Therefore I should encapsulate the interger inside of String.valueOf(int)
so the code becomes TextView.setText(String.valueOf(int));