I am not sure if this is the same issue that you have, but I'll tell mine(and my partial solution)...
I am searching for customized places on Google maps, first time the map activity is active, the near locations are automatic shown on map (perfectly), but I noticed that when I was searching for de exactly same location (using EditText input), the customized places weren't shown on map.
I found out that Geocode results were not the same when I was converting THE PLACE ADDRESS (from the EditText input) and the customized places addresses from the GeoCode (from my database input).
The reason was that the Geocode instance (Geocode(context) or even Geocode(context, locale)) were returning some of the the results in the searched country Locale [the Geocode(context, locale) instance seems not to be working].
Exemple:
(My default device locale is PT-BR)
1 - If I was searching for Milan (Italy), the geocode results from the EditText input(Milan), were in PT-BR (Milão) and the Geocode result from the CUSTOMIZED object located in Milan were coming in IT (Milano).
2 - If I was searching for London(UK), the geocode results from the EditText were in PT-BR (Londres - Reino Unido) [EVEN IF MY INPUT WAS IN ENGLISH] and the Geocode result from the CUSTOMIZED object located in Milan were coming in EN (London - United Kingdom).
This way I could not match the results (I believe the Geocode returns should be in Locale.Default language).
My solution was:
Getting the result address from default Geocoder, comparing its language to the default lang [result.getCountryCode]. If different set a new Geocoder instance using the first result language [new Geocoder(context, Locale.forLanguageTag(result.getCountryCode())]. and keep this new result.
[ I am using the same instance of Geocoder(context, locale) for getting the results from the place I want(from EditText) and getting the results of my custom places(from database), this way, no matter what language I insert on EditText, I always get the correct result ]
Geocoder geocoder = new Geocoder(parentContext);
Address placeResult = null;
try {
List<Address> addresses = geocoder.getFromLocationName(address, 1);
if (addresses.size() > 0) {
placeResult = addresses.get(0);
Log.d(TAG, String.format(">>> CONVERTED PLACE COUNTRY >>> %s <<<", placeResult.getCountryCode()));
if(!placeResult.getCountryCode().equalsIgnoreCase(Locale.getDefault().getCountry())) {
Log.d(TAG, String.format(">>> CHANGING CONVERTED PLACE COUNTRY >>> From: %s To: %s <<<", Locale.getDefault().getCountry(), placeResult.getCountryCode()));
geocoder = new Geocoder(parentContext, Locale.forLanguageTag(placeResult.getCountryCode()));
addresses = geocoder.getFromLocationName(address, 1);
}
placeResult = addresses.get(0);
} catch (IOException e) {
e.printStackTrace();
return;
}
finding my custom places:
try {
studioGeoAddress = geocoder.getFromLocation(studioLatitude, studioLongitude, 1).get(0);
Log.d(TAG, String.format(">>> CONVERTED STUDIO GEO ADDRESS >>> %s <<<", studioGeoAddress.toString()));
Log.d(TAG, String.format(">>> CONVERTED STUDIO LOCALE >>> %s <<<", studioGeoAddress.getLocale()));
Log.d(TAG, String.format(">>> STUDIO PROFILE >>> %s <<<", studioProfile.getDisplayName()));
Log.d(TAG, String.format(">>> STUDIO ADDRESS HAS COUNTRY >>> %s | %s <<<", studioGeoAddress.getCountryName(), placeResult.getCountryName()));
Log.d(TAG, String.format(">>> STUDIO ADDRESS HAS ADMIN >>> %s | %s <<<", studioGeoAddress.getAdminArea(), placeResult.getAdminArea()));
Log.d(TAG, String.format(">>> STUDIO ADDRESS HAS SUB-ADMIN >>> %s | %s <<<", studioGeoAddress.getSubAdminArea(), placeResult.getSubAdminArea()));
Log.d(TAG, String.format(">>> STUDIO ADDRESS HAS LOCALITY >>> %s | %s <<<", studioGeoAddress.getLocality(), placeResult.getLocality()));
Log.d(TAG, String.format(">>> STUDIO ADDRESS HAS SUB-LOCALITY >>> %s | %s <<<", studioGeoAddress.getSubLocality(), placeResult.getSubLocality()));
if (placeResult.getSubAdminArea() != null) {
if (studioGeoAddress.getSubAdminArea() != null) {
Log.d(TAG, String.format(">>> STUDIO SUB-ADMIN >>> %s | %s <<<", studioGeoAddress.getSubAdminArea(), placeResult.getSubAdminArea()));
if(studioGeoAddress.getSubAdminArea().equalsIgnoreCase(placeResult.getSubAdminArea())) {
Log.d(TAG, String.format(">>> STUDIO ADDED TO LIST >>> %s [MATCH] <<<", studioProfile.getDisplayName()));
STUDIOS_LIST.add(studioProfile);
}
}
} catch (IOException e) {
e.printStackTrace();
}
That was my solution, maybe there is something easier or less complicated, but it works for now.
Ps. Sorry about my english..