how do i save data permanently in shared preferences?

@Override
public void ApplyNameDialog(String name) {
   prefs = getSharedPreferences("prefs",MODE_PRIVATE);
   final SharedPreferences.Editor editor = prefs.edit();
    editor.putString("susanth",name);
}

It seems like the string is never saved. You should call editor.commit() or editor.apply()

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top