@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;
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) {
// 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;
}