标签:tin get apply() price 存储 put ring gets shared
存储数据
SharedPreferences.Editor edit = getSharedPreferences("data", MODE_PRIVATE).edit();
edit.putString("bookname", "完美");
edit.putString("anthor", "刘红");
edit.putInt("page", 700);
edit.putInt("price", 230);
edit.apply();
读取数据
SharedPreferences prep = getSharedPreferences("data", MODE_PRIVATE);
String bookname= prep.getString("bookname", "");
String anthor= prep.getString("anthor", "");
int page= prep.getInt("page",0);
int price=prep.getInt("price",0);
标签:tin get apply() price 存储 put ring gets shared
原文地址:http://www.cnblogs.com/cct1314520/p/6486904.html