From b31d264ceb9acb050cd22f49bcb7c10250780a49 Mon Sep 17 00:00:00 2001 From: vng Date: Thu, 8 May 2014 16:02:10 +0300 Subject: [PATCH] [android] Do not use String.isEmpty() - started from SDK 9. --- android/src/com/mapswithme/maps/SearchActivity.java | 3 +-- android/src/com/mapswithme/maps/bookmarks/data/MapObject.java | 2 +- android/src/com/mapswithme/util/StringUtils.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/android/src/com/mapswithme/maps/SearchActivity.java b/android/src/com/mapswithme/maps/SearchActivity.java index e663316aea..7d37553805 100644 --- a/android/src/com/mapswithme/maps/SearchActivity.java +++ b/android/src/com/mapswithme/maps/SearchActivity.java @@ -407,7 +407,7 @@ public class SearchActivity extends MapsWithMeBaseListActivity implements Locati private boolean isShowCategories() { - return getSearchString().isEmpty(); + return getSearchString().length() == 0; } private LocationService m_location; @@ -417,7 +417,6 @@ public class SearchActivity extends MapsWithMeBaseListActivity implements Locati private View mClearQueryBtn; private View mVoiceInput; private View mSearchIcon; - // private RadioGroup mSearchScopeGroup; diff --git a/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java b/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java index 9326b5cedd..1d5f0fa19e 100644 --- a/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java +++ b/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java @@ -24,7 +24,7 @@ public abstract class MapObject private static boolean isEmpty(String s) { - return (s == null || s.isEmpty()); + return (s == null || s.length() == 0); } public void setDefaultIfEmpty(Resources res) diff --git a/android/src/com/mapswithme/util/StringUtils.java b/android/src/com/mapswithme/util/StringUtils.java index 4280873ad1..a454900630 100644 --- a/android/src/com/mapswithme/util/StringUtils.java +++ b/android/src/com/mapswithme/util/StringUtils.java @@ -47,7 +47,7 @@ public class StringUtils for (int i = 0; i < arr.length; ++i) { String s = (arr[i] != null) ? arr[i].toString() : null; - if (s != null && !s.isEmpty()) + if (s != null && s.length() > 0) res = (res == null) ? s : res + delim + s; } return res;