From 00a7823f38a25652e3d05a5f6cc9d7eb98e0356f Mon Sep 17 00:00:00 2001 From: rachytski Date: Sun, 18 Dec 2011 13:27:40 +0400 Subject: [PATCH] [android] calling SaveState/LoadState at particular times. --- android/jni/com/mapswithme/maps/Framework.cpp | 2 ++ android/src/com/mapswithme/maps/MWMActivity.java | 10 +++++----- platform/settings.cpp | 4 ++-- platform/settings.hpp | 2 -- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 9a16a132d3..925c934c0c 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -79,6 +79,7 @@ namespace android void Framework::DeleteRenderPolicy() { + m_work.SaveState(); LOG(LINFO, ("clearing current render policy.")); m_work.SetRenderPolicy(0); } @@ -94,6 +95,7 @@ namespace android try { + m_work.LoadState(); m_work.SetRenderPolicy(CreateRenderPolicy(m_videoTimer, true, rmParams, diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java index 893f0170d7..ae922200b8 100644 --- a/android/src/com/mapswithme/maps/MWMActivity.java +++ b/android/src/com/mapswithme/maps/MWMActivity.java @@ -213,9 +213,7 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - - setupLayout(); - + final String storagePath = getDataStoragePath(); // create folder if it doesn't exist File f = new File(storagePath); @@ -230,10 +228,12 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService e.printStackTrace(); } + setupLayout(); + setupLanguages(); - + checkMeasurementSystem(); - + m_timer = new VideoTimer(); m_locationService = new LocationService(this); diff --git a/platform/settings.cpp b/platform/settings.cpp index b7851b4ac5..6e8dc8a4b8 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -60,7 +60,8 @@ namespace Settings StringStorage & StringStorage::Instance() { - return m_instance; + static StringStorage inst; + return inst; } bool StringStorage::GetValue(string const & key, string & outValue) @@ -78,7 +79,6 @@ namespace Settings Save(); } - StringStorage StringStorage::m_instance; //////////////////////////////////////////////////////////////////////////////////////////// template <> string ToString(string const & str) diff --git a/platform/settings.hpp b/platform/settings.hpp index d941026f0c..dda6a4f721 100644 --- a/platform/settings.hpp +++ b/platform/settings.hpp @@ -10,8 +10,6 @@ namespace Settings class StringStorage { - static StringStorage m_instance; - typedef map ContainerT; ContainerT m_values;