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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by huzhenjie
, 11 months ago
Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference
via Stack Overflow by Sambo Pisal
, 1 month ago
Attempt to invoke virtual method :java.lang.String java.lang.Object.toString() on a null object reference Here is my error contents: java.lang.RuntimeException: Unable to create application com.example.sambovisal.minozchat.MinozChat: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
via GitHub by ligi
, 8 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
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference

Users with the same issue

31 times, 11 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.