diff options
author | kaiyiz <kaiyiz@codeaurora.org> | 2014-03-26 10:18:47 +0800 |
---|---|---|
committer | Brint E. Kriebel <bekit@cyngn.com> | 2014-08-25 20:03:42 +0000 |
commit | c2f8ddc27f2e94d236f50f9a8169c0d27cf557a2 (patch) | |
tree | 8e85715259b3ee94eaa441525ab3ce3f42aada9b | |
parent | 471cf7e42ab0b01a93d62cc638c5a71a9efa2d21 (diff) | |
download | android_packages_apps_DeskClock-c2f8ddc27f2e94d236f50f9a8169c0d27cf557a2.tar.gz android_packages_apps_DeskClock-c2f8ddc27f2e94d236f50f9a8169c0d27cf557a2.tar.bz2 android_packages_apps_DeskClock-c2f8ddc27f2e94d236f50f9a8169c0d27cf557a2.zip |
DeskClock: Search cities with any part of the name
Only the the starting part of the name could be used to search.
Therefore, when try to search the cities with the middle or ending
part of the name, no expected result will be listed.
Use contains() method instead of startsWith() to match the search,
so that all the names containing the search string will be listed
in the result.
CRs-Fixed: 637280
Change-Id: I670a163b9c4df575445b58eeb1cc5070a557550e
-rw-r--r-- | src/com/android/deskclock/worldclock/CitiesActivity.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/deskclock/worldclock/CitiesActivity.java b/src/com/android/deskclock/worldclock/CitiesActivity.java index efc14e086..b5fa499b2 100644 --- a/src/com/android/deskclock/worldclock/CitiesActivity.java +++ b/src/com/android/deskclock/worldclock/CitiesActivity.java @@ -246,7 +246,7 @@ public class CitiesActivity extends Activity implements OnCheckedChangeListener, // If the city name begins with the query, add the city into the list. // If the query is empty, the city will automatically be added to the list. String cityName = city.mCityName.trim().toUpperCase(); - if (city.mCityId != null && cityName.startsWith(modifiedQuery)) { + if (city.mCityId != null && cityName.contains(modifiedQuery)) { filteredList.add(city); } } |