From b18dae5bef355c922e7ec9497c6ddbbe48061514 Mon Sep 17 00:00:00 2001 From: Emux Date: Thu, 25 Aug 2016 20:05:26 +0300 Subject: [PATCH] Samples: fix some folder permissions, #32 --- .../src/org/oscim/android/filepicker/FilePicker.java | 4 +++- vtm-app/src/org/oscim/app/filepicker/FilePicker.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java b/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java index d7fb536fb..3cfd4dfb7 100755 --- a/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java +++ b/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java @@ -1,5 +1,6 @@ /* * Copyright 2010, 2011, 2012 mapsforge.org + * Copyright 2016 devemux86 * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free Software @@ -21,6 +22,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; +import android.os.Environment; import android.view.View; import android.widget.AdapterView; import android.widget.GridView; @@ -58,7 +60,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe private static final String PREFERENCES_FILE = "FilePicker"; private static final String CURRENT_DIRECTORY = "currentDirectory"; - private static final String DEFAULT_DIRECTORY = "/"; + private static final String DEFAULT_DIRECTORY = Environment.getExternalStorageDirectory().getAbsolutePath(); private static final int DIALOG_FILE_INVALID = 0; // private static final int DIALOG_FILE_SELECT = 1; diff --git a/vtm-app/src/org/oscim/app/filepicker/FilePicker.java b/vtm-app/src/org/oscim/app/filepicker/FilePicker.java index 764e3514c..77c31a3a3 100755 --- a/vtm-app/src/org/oscim/app/filepicker/FilePicker.java +++ b/vtm-app/src/org/oscim/app/filepicker/FilePicker.java @@ -1,5 +1,6 @@ /* * Copyright 2010, 2011, 2012 mapsforge.org + * Copyright 2016 devemux86 * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free Software @@ -23,6 +24,7 @@ import android.content.SharedPreferences.Editor; import android.os.Build; import android.os.Bundle; +import android.os.Environment; import android.view.View; import android.widget.AdapterView; import android.widget.GridView; @@ -60,7 +62,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe public static final String SELECTED_FILE = "selectedFile"; private static final String CURRENT_DIRECTORY = "currentDirectory"; - private static final String DEFAULT_DIRECTORY = "/"; + private static final String DEFAULT_DIRECTORY = Environment.getExternalStorageDirectory().getAbsolutePath(); private static final int DIALOG_FILE_INVALID = 0; // private static final int DIALOG_FILE_SELECT = 1; private static Comparator fileComparator = getDefaultFileComparator();