App Crashing When Fetching From String Ressources
I have a string array in the string.xml ressources; - Successful sign up
- Invalid username!\n(mo
Solution 1:
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!
Post a Comment for "App Crashing When Fetching From String Ressources"