java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference


Solutions on the web2

Solution icon of github
via GitHub by huzhenjie
, 9 months ago
Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference

Solution icon of github
via GitHub by ligi
, 6 months ago
Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference java.lang.RuntimeException: Unable to create application org.ligi.gobandroid_hd.TestApp: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference

Stack trace

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5364)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

3 times, 3 months ago
Once, 1 year ago
31 times, 9 months ago