From a3cff80263fa82d85f1728d922c532fc114f5ccc Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 7 Jul 2011 14:53:15 +0300 Subject: [PATCH] [android] Fixed external storage path --- android/src/com/mapswithme/maps/MWMActivity.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java index b8d3cf3a57..246b8bea8f 100644 --- a/android/src/com/mapswithme/maps/MWMActivity.java +++ b/android/src/com/mapswithme/maps/MWMActivity.java @@ -32,12 +32,8 @@ public class MWMActivity extends Activity private String getDataStoragePath() { - String storagePath = ""; - storagePath = Environment.getExternalStorageDirectory().getAbsolutePath(); - storagePath = storagePath.concat(String.format("/%s", PACKAGE_NAME)); - File f = new File(storagePath); - f.mkdirs(); - return storagePath; + String storagePath = Environment.getExternalStorageDirectory().getAbsolutePath(); + return storagePath.concat(String.format("/%s/", PACKAGE_NAME)); } @Override @@ -45,9 +41,14 @@ public class MWMActivity extends Activity { super.onCreate(savedInstanceState); + final String storagePath = getDataStoragePath(); + // create folder if it doesn't exist + File f = new File(storagePath); + f.mkdirs(); + try { - nativeInit(getAppBundlePath(), getDataStoragePath()); + nativeInit(getAppBundlePath(), storagePath); } catch (NameNotFoundException e) {