SharedPreferences存储set

作者: 奔跑的图腾 | 来源:发表于2018-03-08 10:09 被阅读0次
    Set<String> checkAnswer = new HashSet<String>();
    checkAnswer=(HashSet<String>)SPUtils.get(context,message.getFrom()+"%%"+message.getTo(),checkAnswer);
    Log.d("TrueWordcheckAnswer","checkAnswer:"+checkAnswer.toString());
    
    if (checkAnswer.isEmpty() || (!checkAnswer.contains(message.getMsgId()))){
        checkAnswer = new HashSet<String>(checkAnswer);
        checkAnswer.add(message.getMsgId());
        SPUtils.put(context,message.getFrom()+"%%"+message.getTo(),checkAnswer);
    }
    

    相关文章

      网友评论

        本文标题:SharedPreferences存储set

        本文链接:https://www.haomeiwen.com/subject/mypjfftx.html