| 355 | } |
| 356 | |
| 357 | public static void saveStat(Context context, String path, String fileName, String stat) { |
| 358 | File fPath = new File(path); |
| 359 | if (fPath.exists() || fPath.mkdirs()) { |
| 360 | try { |
| 361 | OutputStream out = new BufferedOutputStream(new FileOutputStream(path+fileName)); |
| 362 | byte [] bytes = stat.getBytes(); |
| 363 | out.write(bytes); |
| 364 | out.close(); |
| 365 | Toast.makeText(context, context.getString(R.string.save_success), Toast.LENGTH_SHORT).show(); |
| 366 | } catch (Exception e) { |
| 367 | Toast.makeText(context, context.getString(R.string.save_fail), Toast.LENGTH_SHORT).show(); |
| 368 | } |
| 369 | } |
| 370 | else Toast.makeText(context, context.getString(R.string.path_not_exist), Toast.LENGTH_SHORT).show(); |
| 371 | } |
| 372 | |
| 373 | public static void exportDB(final String path, final Handler handler) { |
| 374 | //File f = new File(path); |