From ab4b28fd432392f9bdbd18eb10b738c76f53405f Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 22 Mar 2018 14:42:15 +0200 Subject: [PATCH] added two methods --- .../android/sample1/SampleApplication.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java index 368f6dac5f..726ae2c593 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java @@ -229,6 +229,27 @@ public class SampleApplication extends Application { keyName.replace('_', ' ')); } + @Override + public String getSynonyms(AbstractPoiType type) { + AbstractPoiType baseLangType = type.getBaseLangType(); + if (baseLangType != null) { + return getSynonyms(baseLangType); + } + return getSynonyms(type.getIconKeyName()); + } + + @Override + public String getSynonyms(String keyName) { + try { + Field f = R.string.class.getField("synonyms_poi_" + keyName); + if (f != null) { + Integer in = (Integer) f.get(null); + return getString(in); + } + } catch (Exception e) { + } + return ""; + } });