chrisbanes / Android-BitmapCache

Android-BitmapCache is a specialised cache, for use with Android Bitmap objects.
834 stars 224 forks source link

Exception because getCallback() is Honeycomb API #14

Closed pboos closed 11 years ago

pboos commented 11 years ago

https://github.com/chrisbanes/Android-BitmapCache/blob/master/library/src/uk/co/senab/bitmapcache/CacheableBitmapDrawable.java#L167

This line fails with:

E/AndroidRuntime( 2918): java.lang.NoSuchMethodError: uk.co.senab.bitmapcache.CacheableBitmapDrawable.getCallback
E/AndroidRuntime( 2918):    at uk.co.senab.bitmapcache.CacheableBitmapDrawable.checkCallback(CacheableBitmapDrawable.java:167)
E/AndroidRuntime( 2918):    at uk.co.senab.bitmapcache.CacheableBitmapDrawable.draw(CacheableBitmapDrawable.java:66)
E/AndroidRuntime( 2918):    at android.widget.ImageView.onDraw(ImageView.java:872)
E/AndroidRuntime( 2918):    at android.view.View.draw(View.java:6902)

I guess you will have to intercept the setCallback method and store the callback yourself. Too bad setCallback is API 1 and getCallback is API 11. Confusing mistake by google.

Btw. You do not run lint to check against such errors?

chrisbanes commented 11 years ago

@pboos: I've started using IntelliJ, hence the lack of obvious Lint. It's still my fault for not testing on a Gingerbread device like I usually do.

pboos commented 11 years ago

@chrisbanes That is what I guessed. I switched to IntelliJ as well. Got lint running through maven, but have it reporting some TargetApi mistakes, even though I added @TargetApi correctly. Might be because of scala though.