PHP
·
发表于 5年以前
·
阅读量:8296
操作步骤:
SharedPreferences.Editor editor = getSharedPreferences("UPDATE_DATA_TIME", Context.MODE_PRIVATE).edit();
editor.putString("data", "你好");
//保存数据
SharedPreferences sp = getSharedPreferences("UPDATE_DATA_TIME", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString("data", "你好");
editor.commit();
//取出数据
String name=sp.getString("data");
Log.v("测试数据",name);
}