+ SharedPreferences appPrefs =
+ PreferenceManager.getDefaultSharedPreferences(MainApp.getAppContext());
+ // due to backward compatibility
+ Integer cacheSize = CACHE_SIZE_MB * 1024 * 1024;
+ try {
+ cacheSize = appPrefs.getInt("pref_cache_size", cacheSize);
+ } catch (ClassCastException e) {
+ String temp = appPrefs.getString("pref_cache_size",
+ cacheSize.toString());
+ cacheSize = Integer.decode(temp) * 1024 * 1024;
+ }
+