Android LruCache on Android 1.6+

I need to use LruCache (api from Android 3.1) in Android 1.6+

I use the Android v4 support library that supports LruCache (a record with this guide http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html#memory-cache ) but the problem is that I keep I get a NoClassDefNotFoundError. I include the support.v4 library in my project (in another activity I use ViewPager ...)

Does anyone have an idea why this happened?

+3
source share
2 answers

To avoid the problem, I included LruClass.java in my own project and NoClassDefNotFoundError no longer works

LruClass.java is located in:

Android sdk location/extras/android/support/v4/src/java/android/support/v4/util/LruCache.java

-2

android.support.v4.util.LruCache<K, V> not android.util.LruCache<K, V>, android API >= 12... , SDK...

+12

All Articles