java.lang.NullPointerException: Attempt to invoke interface method 'android.content.SharedPreferences$Editor android.content.SharedPreferences$Editor.putString(java.lang.String, java.lang.String)' 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 Stack Overflow by Jonathon Charles Loch
, 1 year ago
Attempt to invoke interface method 'android.content.SharedPreferences$Editor android.content.SharedPreferences$Editor.putString(java.lang.String, java.lang.String)' on a null object reference
via Stack Overflow by Sid
, 10 months ago
Attempt to invoke virtual method 'void android.app.ActionBar.setTitle(int)' on a null object reference
via Stack Overflow by Axium
, 2 weeks 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 user7939485
, 3 months ago
Attempt to invoke virtual method 'android.database.Cursor android.database.sqlite.SQLiteDatabase.query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String)' on a null object reference
via Stack Overflow by sockevalley
, 4 months ago
Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
via GitHub by bdyz1016
, 1 year ago
Attempt to invoke virtual method 'boolean cn.showclear.sc_sip.SipConfigurationService.getBoolean(java.lang.String, boolean)' on a null object reference
java.lang.NullPointerException: Attempt to invoke interface method 'android.content.SharedPreferences$Editor android.content.SharedPreferences$Editor.putString(java.lang.String, java.lang.String)' on a null object reference
at com.lochdownstudios.simplePurchaseOrderer.MainActivity.save(MainActivity.java:119)
at com.lochdownstudios.simplePurchaseOrderer.MainActivity.onCreate(MainActivity.java:39)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)

Users with the same issue

You are the first who have seen this exception.

Write tip

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