数据存储

来源:互联网 发布:python 画时间轴 分钟 编辑:程序博客网 时间:2024/06/05 13:31

SpUtils

/**保存数据**/SpUtils utils = new SpUtils(getContext(), "config");utils.put("shopName", shopBean.getShopName());utils.put("shopId", shopBean.getShopId());utils.put("areaId", shopBean.getAreaId());
//提取数据SpUtils sp = new SpUtils(getContext(), "config");//config没有数据,则不会执行shopId = Integer.parseInt(sp.getString("shopId"));areaId = Integer.parseInt(sp.getString("areaId"));
原创粉丝点击