]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
Move code using ISO to language resources into IsoUtils.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index 266ea87248ad4cf08ea38595eb1fd108334c62a2..9dc901d23abb87945adf648306645fe2a2da150e 100644 (file)
@@ -282,14 +282,23 @@ public class DictionaryManagerActivity extends ActionBarActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        // This must be first, otherwise the actiona bar doesn't get
+        // This must be first, otherwise the action bar doesn't get
         // styled properly.
-        setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
+        // Unfortunately on some (Samsung?) Android versions this
+        // results in a ClassCastException...
+        boolean themeSet = true;
+        try {
+            setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
+        } catch (ClassCastException e) {
+            themeSet = false;
+        }
 
         super.onCreate(savedInstanceState);
         Log.d(LOG, "onCreate:" + this);
 
         application = (DictionaryApplication) getApplication();
+        if (!themeSet)
+            setTheme(application.getSelectedTheme().themeId);
 
         blockAutoLaunch = false;
 
@@ -661,8 +670,8 @@ public class DictionaryManagerActivity extends ActionBarActivity {
             builder.append(getString(R.string.updateAvailable));
         }
         for (IndexInfo indexInfo : sortedIndexInfos) {
-            final View button = application.createButton(buttons.getContext(), dictionaryInfo,
-                                indexInfo);
+            final View button = IsoUtils.INSTANCE.createButton(buttons.getContext(), dictionaryInfo,
+                                indexInfo, application.languageButtonPixels);
             buttons.addView(button);
 
             if (canLaunch) {