]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Avoid inheriting from Application.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index ac77c8558c8d6be0e62a06ac36522f261436a0bd..008b57de6c1ef6869612267e22177b1e79829a63 100644 (file)
@@ -226,10 +226,12 @@ public class DictionaryActivity extends ActionBarActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
+        DictionaryApplication.INSTANCE.init(getApplicationContext());
+        application = DictionaryApplication.INSTANCE;
         // This needs to be before super.onCreate, otherwise ActionbarSherlock
         // doesn't makes the background of the actionbar white when you're
         // in the dark theme.
-        setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
+        setTheme(application.getSelectedTheme().themeId);
 
         Log.d(LOG, "onCreate:" + this);
         super.onCreate(savedInstanceState);
@@ -241,7 +243,6 @@ public class DictionaryActivity extends ActionBarActivity {
 
         setContentView(R.layout.dictionary_activity);
 
-        application = (DictionaryApplication) getApplication();
         theme = application.getSelectedTheme();
         textColorFg = getResources().getColor(theme.tokenRowFgColor);