]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
Avoid inheriting from Application.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index 0374794d82a84b48d65b70041d64341e53758384..891c0422ec3ea2ca679506a1e52decae45f8b58d 100644 (file)
@@ -282,23 +282,16 @@ public class DictionaryManagerActivity extends ActionBarActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
+        DictionaryApplication.INSTANCE.init(getApplicationContext());
+        application = DictionaryApplication.INSTANCE;
         // This must be first, otherwise the action bar doesn't get
         // styled properly.
-        // 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;
-        }
+        setTheme(application.getSelectedTheme().themeId);
 
         super.onCreate(savedInstanceState);
         Log.d(LOG, "onCreate:" + this);
 
-        application = (DictionaryApplication) getApplication();
-        if (!themeSet)
-            setTheme(application.getSelectedTheme().themeId);
+        setTheme(application.getSelectedTheme().themeId);
 
         blockAutoLaunch = false;
 
@@ -670,8 +663,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) {