diff options
Diffstat (limited to 'main/src/cgeo/geocaching/utils/DebugUtils.java')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/DebugUtils.java | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/main/src/cgeo/geocaching/utils/DebugUtils.java b/main/src/cgeo/geocaching/utils/DebugUtils.java index 4bbc74f..07aac64 100644 --- a/main/src/cgeo/geocaching/utils/DebugUtils.java +++ b/main/src/cgeo/geocaching/utils/DebugUtils.java @@ -1,6 +1,5 @@ package cgeo.geocaching.utils; -import cgeo.geocaching.CgeoApplication; import cgeo.geocaching.R; import org.eclipse.jdt.annotation.NonNull; @@ -17,29 +16,22 @@ import java.util.Locale; public class DebugUtils { - private DebugUtils() { - // utility class - } + private DebugUtils() { + // utility class + } - public static void createMemoryDump(final @NonNull Context context) { - try { - final Date now = new Date(); - final SimpleDateFormat fileNameDateFormat = new SimpleDateFormat( - "yyyy-MM-dd_hh-mm", Locale.US); - File file = FileUtils.getUniqueNamedFile(Environment - .getExternalStorageDirectory().getPath() - + File.separatorChar - + "cgeo_dump_" - + fileNameDateFormat.format(now) + ".hprof"); - android.os.Debug.dumpHprofData(file.getPath()); - Toast.makeText(CgeoApplication.getInstance() - .getApplicationContext(), - context.getString(R.string.init_memory_dumped, - file.getAbsolutePath()), - Toast.LENGTH_LONG).show(); - ShareUtils.share(context, file, R.string.init_memory_dump); - } catch (IOException e) { - Log.e("createMemoryDump", e); - } - } + public static void createMemoryDump(final @NonNull Context context) { + try { + final Date now = new Date(); + final SimpleDateFormat fileNameDateFormat = new SimpleDateFormat("yyyy-MM-dd_hh-mm", Locale.US); + File file = FileUtils.getUniqueNamedFile(Environment.getExternalStorageDirectory().getPath() + + File.separatorChar + "cgeo_dump_" + fileNameDateFormat.format(now) + ".hprof"); + android.os.Debug.dumpHprofData(file.getPath()); + Toast.makeText(context, context.getString(R.string.init_memory_dumped, file.getAbsolutePath()), + Toast.LENGTH_LONG).show(); + ShareUtils.share(context, file, R.string.init_memory_dump); + } catch (IOException e) { + Log.e("createMemoryDump", e); + } + } } |
