ciao!
al click su un bottone itero su un file json locale, e creo un file txt.
il problema è che il file ha una sola riga!codice:private void createTxt() { try { JSONArray jsonArray = new JSONArray(JsonFile.read(".........")); StringBuilder sb = new StringBuilder(); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jo = jsonArray.getJSONObject(i); sb.append(jo.get("title")).append("\n"); } JsonFile.create(sb.toString(), Const.LOCAL_PATH + Const.TXT_FILMS); } catch (ClientProtocolException ex) { } catch (IOException ex) { } catch (JSONException ex) { } }
però se stampo la lista, le voci ci sono tutte.
qualche dritta??

Rispondi quotando



