[Android] src: Don't hardcode /sdcard in VlcCrashHandler
Edward Wang
git at videolan.org
Tue Jul 3 16:47:19 CEST 2012
android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Tue Jul 3 10:46:03 2012 -0400| [45955cd72606604db835709561fe672727992764] | committer: Edward Wang
src: Don't hardcode /sdcard in VlcCrashHandler
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=45955cd72606604db835709561fe672727992764
---
vlc-android/src/org/videolan/vlc/VlcCrashHandler.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/VlcCrashHandler.java b/vlc-android/src/org/videolan/vlc/VlcCrashHandler.java
index 4f1b8db..9d8bff5 100644
--- a/vlc-android/src/org/videolan/vlc/VlcCrashHandler.java
+++ b/vlc-android/src/org/videolan/vlc/VlcCrashHandler.java
@@ -31,6 +31,7 @@ import java.io.StringWriter;
import java.io.Writer;
import java.lang.Thread.UncaughtExceptionHandler;
+import android.os.Environment;
import android.text.format.DateFormat;
import android.util.Log;
@@ -54,8 +55,9 @@ public class VlcCrashHandler implements UncaughtExceptionHandler {
printWriter.close();
Log.e(TAG, stacktrace);
- writeLog(stacktrace, "//sdcard//vlc_crash");
- writeLogcat("//sdcard//vlc_logcat");
+ String sdcardPath = Environment.getExternalStorageDirectory().getPath();
+ writeLog(stacktrace, sdcardPath + "/vlc_crash");
+ writeLogcat(sdcardPath + "/vlc_logcat");
defaultUEH.uncaughtException(thread, ex);
}
More information about the Android
mailing list