aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYraFyra <yrafyra@gmail.com>2012-11-04 23:10:38 +0100
committerYraFyra <yrafyra@gmail.com>2012-11-05 23:34:57 +0100
commiteafae66a89560918f186e92f7d24130b09004181 (patch)
tree1ffaae036fb89427768d52537b897232ad50f39d
parent26954590cf375f0a0e968cd5197758a617cf3bb9 (diff)
downloadcgeo-eafae66a89560918f186e92f7d24130b09004181.zip
cgeo-eafae66a89560918f186e92f7d24130b09004181.tar.gz
cgeo-eafae66a89560918f186e92f7d24130b09004181.tar.bz2
Solved force close in SimpleDirChooser caused by bad default value
If no path is entered and SimpleDirChooser is opened then it will crash due to IndexOfOfBoundsExcep. This happened to me when trying to use map themes the first time ever today. Fixed minor layout issues releated to map themes.
-rw-r--r--main/res/layout/init.xml3
-rw-r--r--main/src/cgeo/geocaching/files/SimpleDirChooser.java4
2 files changed, 6 insertions, 1 deletions
diff --git a/main/res/layout/init.xml b/main/res/layout/init.xml
index 41e3aad..8450ff8 100644
--- a/main/res/layout/init.xml
+++ b/main/res/layout/init.xml
@@ -726,6 +726,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
+ android:layout_marginBottom="5dip"
android:layout_gravity="center_vertical"
android:gravity="left"
android:padding="3dip"
diff --git a/main/src/cgeo/geocaching/files/SimpleDirChooser.java b/main/src/cgeo/geocaching/files/SimpleDirChooser.java
index 6675305..781eb8e 100644
--- a/main/src/cgeo/geocaching/files/SimpleDirChooser.java
+++ b/main/src/cgeo/geocaching/files/SimpleDirChooser.java
@@ -3,6 +3,8 @@ package cgeo.geocaching.files;
import cgeo.geocaching.R;
import cgeo.geocaching.activity.ActivityMixin;
+import org.apache.commons.lang3.StringUtils;
+
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
@@ -43,7 +45,7 @@ public class SimpleDirChooser extends ListActivity {
super.onCreate(savedInstanceState);
final Bundle extras = getIntent().getExtras();
String startDir = extras.getString(START_DIR);
- if (startDir == null) {
+ if (StringUtils.isBlank(startDir)) {
startDir = Environment.getExternalStorageDirectory().getPath();
} else {
startDir = startDir.substring(0, startDir.lastIndexOf(File.separatorChar));