]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
Fix error message when download manager in unavailable.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index 0374794d82a84b48d65b70041d64341e53758384..1b27dbe5e17ff2b8a3975ab3fab27eb974d61841 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) {
@@ -731,8 +724,9 @@ public class DictionaryManagerActivity extends ActionBarActivity {
         // Due to a bug, cursor is null instead of empty when
         // the download manager is disabled.
         if (cursor == null) {
+            String msg = getString(R.string.downloadManagerQueryFailed);
             new AlertDialog.Builder(DictionaryManagerActivity.this).setTitle(getString(R.string.error))
-            .setMessage(getString(R.string.downloadFailed, R.string.downloadManagerQueryFailed))
+            .setMessage(getString(R.string.downloadFailed, msg))
             .setNeutralButton("Close", null).show();
             return;
         }