diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-05-17 17:51:22 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-05-17 17:51:22 +0200 |
| commit | b21285e477f71e8417df8ac564e1e86c5a82f30c (patch) | |
| tree | 1bb0a24737ec653a51bbaf4dfe71e5a80b601e1a /main/src/cgeo/geocaching/utils | |
| parent | e2d03264f63d644d72c369120d542969723398a1 (diff) | |
| download | cgeo-b21285e477f71e8417df8ac564e1e86c5a82f30c.zip cgeo-b21285e477f71e8417df8ac564e1e86c5a82f30c.tar.gz cgeo-b21285e477f71e8417df8ac564e1e86c5a82f30c.tar.bz2 | |
some formatting fixes
Diffstat (limited to 'main/src/cgeo/geocaching/utils')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/DebugUtils.java | 42 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/utils/ShareUtils.java | 29 |
2 files changed, 30 insertions, 41 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); + } + } } diff --git a/main/src/cgeo/geocaching/utils/ShareUtils.java b/main/src/cgeo/geocaching/utils/ShareUtils.java index b587547..bfd6838 100644 --- a/main/src/cgeo/geocaching/utils/ShareUtils.java +++ b/main/src/cgeo/geocaching/utils/ShareUtils.java @@ -9,22 +9,19 @@ import android.net.Uri; import java.io.File; public class ShareUtils { - private ShareUtils() { - // utility class - } + private ShareUtils() { + // utility class + } - public static void share(final Context context, final @NonNull File file, - final @NonNull String mimeType, final int titleResourceId) { - final Intent shareIntent = new Intent(); - shareIntent.setAction(Intent.ACTION_SEND); - shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); - shareIntent.setType(mimeType); - context.startActivity(Intent.createChooser(shareIntent, - context.getString(titleResourceId))); - } + public static void share(final Context context, final @NonNull File file, final @NonNull String mimeType, final int titleResourceId) { + final Intent shareIntent = new Intent(); + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); + shareIntent.setType(mimeType); + context.startActivity(Intent.createChooser(shareIntent, context.getString(titleResourceId))); + } - public static void share(final Context context, final @NonNull File file, - final int titleResourceId) { - share(context, file, "*/*", titleResourceId); - } + public static void share(final Context context, final @NonNull File file, final int titleResourceId) { + share(context, file, "*/*", titleResourceId); + } } |
