That wave friends, I would like to know about the question, what happens is that I have this:
String[] data = {"Ejemplo 1", "Ejemplo 2", "Ejemplo 3", "Ejemplo 4"};
and I have this string arrangement in my resources:
<string-array
name="ejemplos">
<item>Ejemplo 1</item>
<item>Ejemplo 2</item>
<item>Ejemplo 3</item>
<item>Ejemplo 4</item>
</string-array>
I would like to initialize or equalize the "examples" of resources in the data variable.
I'm trying this way but it throws me an exception
private String[] data = getResources().getStringArray(R.array.ejemplos);
and this is the error
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources ()' on a null object reference
I hope you answer, thank you in advance