diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-08-26 20:58:07 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-08-26 20:58:07 +0200 |
| commit | 66a91519690729bfb5bee2103430b5dd9ba88ceb (patch) | |
| tree | 45738b6106781d8f92903415176c254c95265691 /main/src/cgeo/geocaching/DataStore.java | |
| parent | 29ce5d0b3d316a8deececa1cfcc9d3553ff8fa70 (diff) | |
| parent | ae68c806e906b2447cc3231529c9f667210200e3 (diff) | |
| download | cgeo-66a91519690729bfb5bee2103430b5dd9ba88ceb.zip cgeo-66a91519690729bfb5bee2103430b5dd9ba88ceb.tar.gz cgeo-66a91519690729bfb5bee2103430b5dd9ba88ceb.tar.bz2 | |
Merge remote-tracking branch 'origin/release'
Diffstat (limited to 'main/src/cgeo/geocaching/DataStore.java')
| -rw-r--r-- | main/src/cgeo/geocaching/DataStore.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java index 7406116..b6503ab 100644 --- a/main/src/cgeo/geocaching/DataStore.java +++ b/main/src/cgeo/geocaching/DataStore.java @@ -3107,11 +3107,16 @@ public class DataStore { } public static String[] getSuggestions(final String table, final String column, final String input) { - final Cursor cursor = database.rawQuery("SELECT DISTINCT " + column - + " FROM " + table - + " WHERE " + column + " LIKE ?" - + " ORDER BY " + column + " COLLATE NOCASE ASC;", new String[] { getSuggestionArgument(input) }); - return cursorToColl(cursor, new LinkedList<String>(), GET_STRING_0).toArray(new String[cursor.getCount()]); + try { + final Cursor cursor = database.rawQuery("SELECT DISTINCT " + column + + " FROM " + table + + " WHERE " + column + " LIKE ?" + + " ORDER BY " + column + " COLLATE NOCASE ASC;", new String[] { getSuggestionArgument(input) }); + return cursorToColl(cursor, new LinkedList<String>(), GET_STRING_0).toArray(new String[cursor.getCount()]); + } catch (final RuntimeException e) { + Log.e("cannot get suggestions from " + table + "->" + column + " for input '" + input + "'", e); + return new String[0]; + } } public static String[] getSuggestionsOwnerName(final String input) { |
