Here what's wrong with the code above:
The resources of the Activity
aren't available before the onCreate
method gets called. So, trying to access the resources by initializing the string array
when instantiating the Activity
will throw an NPE.
The same issue is deeply explained here.
Thanks to @Rembo for this help!