]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Fixed font problems!
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index 89869b646e0dd4aa543288fe514cf68f9ffa0e62..e1c4c707d1d0d0d380b5771cedeade170e5b2bb5 100644 (file)
@@ -250,6 +250,7 @@ public class DictionaryActivity extends ListActivity {
     \r
     final int fontWorkAround = prefs.getInt(C.FONT_WORKAROUND, 1);\r
     if (fontWorkAround == 0) {\r
+      Log.w(LOG, "Loading font seemed to fail last time, trying with default font.");\r
       Toast.makeText(this, getString(R.string.fontWorkaround), Toast.LENGTH_LONG).show();\r
       prefs.edit().putString(getString(R.string.fontKey), "SYSTEM").commit();\r
     }\r
@@ -278,8 +279,6 @@ public class DictionaryActivity extends ListActivity {
     } catch (NumberFormatException e) {\r
       fontSizeSp = 14;\r
     } \r
-    // Things worked with loading the font.\r
-    prefs.edit().putInt(C.FONT_WORKAROUND, 1).commit();\r
 \r
 \r
     setContentView(R.layout.dictionary_activity);\r
@@ -392,6 +391,11 @@ public class DictionaryActivity extends ListActivity {
   @Override\r
   protected void onPause() {\r
     super.onPause();\r
+    \r
+    // If the app exits normally, this will happen.\r
+    final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r
+    Log.d(LOG, "Loading font seemed to work.");\r
+    prefs.edit().putInt(C.FONT_WORKAROUND, 1).commit();\r
   }\r
   \r
   private static void setDictionaryPrefs(final Context context,\r