Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. try {
  2. SimpleDateFormat sdf = new SimpleDateFormat(
  3. "yyyy-MM-dd", Locale.US);
  4. String currentDateandTime = sdf.format(new Date());
  5. final File path = new File(Environment.getExternalStorageDirectory(), "SMOK_komunal");
  6. if (!path.exists()) {
  7. path.mkdir();
  8. }
  9. Log.e("path ", path.getAbsolutePath());
  10. Runtime.getRuntime().exec("logcat -f " + path + File.separator + "dbo_logcat_" + currentDateandTime + ".txt");
  11. } catch (IOException e) {
  12. e.printStackTrace();
  13. }
  14.  
  15. Log.e("path ", path.getAbsolutePath()+currentDateandTime );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement