From: Thad Hughes Date: Wed, 9 May 2012 22:07:10 +0000 (-0700) Subject: Fixed font problems! X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=02f5c7207dc34715fdb0fda9c9edc4aa2c78adbc Fixed font problems! --- diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fce4847..ca1e53f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -8,7 +8,7 @@ android:versionName="3.2.2" android:installLocation="auto"> - + diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 89869b6..e1c4c70 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -250,6 +250,7 @@ public class DictionaryActivity extends ListActivity { final int fontWorkAround = prefs.getInt(C.FONT_WORKAROUND, 1); if (fontWorkAround == 0) { + Log.w(LOG, "Loading font seemed to fail last time, trying with default font."); Toast.makeText(this, getString(R.string.fontWorkaround), Toast.LENGTH_LONG).show(); prefs.edit().putString(getString(R.string.fontKey), "SYSTEM").commit(); } @@ -278,8 +279,6 @@ public class DictionaryActivity extends ListActivity { } catch (NumberFormatException e) { fontSizeSp = 14; } - // Things worked with loading the font. - prefs.edit().putInt(C.FONT_WORKAROUND, 1).commit(); setContentView(R.layout.dictionary_activity); @@ -392,6 +391,11 @@ public class DictionaryActivity extends ListActivity { @Override protected void onPause() { super.onPause(); + + // If the app exits normally, this will happen. + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + Log.d(LOG, "Loading font seemed to work."); + prefs.edit().putInt(C.FONT_WORKAROUND, 1).commit(); } private static void setDictionaryPrefs(final Context context,