2016-08-08 7 views

답변

0
Cache cache = AppController.getInstance().getRequestQueue().getCache(); 
      Cache.Entry entry = cache.get(API); 
      if (entry != null) { 
       try { 
        String data = new String(entry.data, "UTF-8"); 
        JSONObject jobj = new JSONObject(data); 
        FileWriter file = new FileWriter(cxt.getFilesDir().getPath() + "/" + fileName); 
        String jsonString = jobj.toString(); 
        file.write(jsonString); 
        file.flush(); 
        file.close(); 
        // prepareListData(jobj); 
       } catch (UnsupportedEncodingException e) { 
        e.printStackTrace(); 
       } 
      }