So I am trying to get a string resource in my project but when I called context.getResources().getString(...), I get a NullPointerException. In deb
context.getResources().getString(...)
NullPointerException
If I had to guess, you are trying to call this in an initializer. Do not attempt to use getResources() before the super.onCreate() call in your activity returns.
getResources()
super.onCreate()