MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / saveStat

Method saveStat

app/src/main/java/com/dctimer/util/Utils.java:357–371  ·  view source on GitHub ↗
(Context context, String path, String fileName, String stat)

Source from the content-addressed store, hash-verified

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);

Callers 1

onClickMethod · 0.95

Calls 4

writeMethod · 0.80
showMethod · 0.80
getStringMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected