When it crashes, I get this in the logcat:
Unable to instantiate activity ComponentInfo{com.myclass}: java.lang.NullPointerException

So, am I doing it wrong, or is this expected behavior? Looking over the documentation,
I don't see anything to lead me to think that the resources wouldn't be available while the main activity is being constructed.

1 Answer
1

I don't think you can call getString on the Activity class as it may not have been properly initialised yet. You may need to split the declaration (keep it as a public String) and then the assignment (move that to onCreate).