SharedPreferences 存储

写入

SharedPreferences.Editor editor = getSharedPreferences("GameData",
                MODE_WORLD_WRITEABLE).edit();
        editor.putString(payCode, payCode);
        editor.commit();

读取

 SharedPreferences read = getSharedPreferences("GameData",
                MODE_WORLD_READABLE);
        String value = read.getString(payCode, "");
  点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注