Save ArrayList in shared preferences

前端 未结 2 812
生来不讨喜
生来不讨喜 2021-01-13 07:16

i am searching for hours to find out why saving boolean list in shared preferences is not working.

The methods are not saving or loading something... the loadmethod

2条回答
  •  逝去的感伤
    2021-01-13 07:55

    public static boolean saveArrayList()
    {
    
    SharedPreferences sp = SharedPreferences.getDefaultSharedPreferences(this);
    SharedPreferences.Editor mEdit1 = sp.edit();
    mEdit1.putInt("Status_size", sKey.size()); /* sKey is an array List*/ 
    
        for(int i=0;i

提交回复
热议问题