1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
FileOutputStream fos; try { String payload = "23456"; String fileName = "12345"; fos = context.openFileOutput(fileName, Context.MODE_PRIVATE); fos.write(payload.getBytes()); fos.close(); //Log.d(debug_tag, "寫檔: " + fileName); } catch (Exception e) { Log.w(debug_tag, "fail to save file " + e.toString()); } |