SharedPreferences keep getting default value

前端 未结 3 437
[愿得一人]
[愿得一人] 2020-12-22 11:58

I keep Getting the Default value either my UI will display null or if I use integers it displays that default value as well here it is in the string form plz help

         


        
3条回答
  •  天命终不由人
    2020-12-22 12:13

    This line

    editor.putString(newUserScore1, null);

    should be

    editor.putString("NewuserScore1",newUserScore1);
    

    and also don't forget to commit your changes using editor.commit();

提交回复
热议问题