I am trying to run "BitmapFun" official example but getting the following errors:
1)Cannot resolve symbol KITKAT 2) Cannot resolve method getAllocationByteCount()
Any help ?
My AndroidManifest.xml :
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="19" />
and here is the code :
@TargetApi(VERSION_CODES.KITKAT)
public static int getBitmapSize(BitmapDrawable value) {
Bitmap bitmap = value.getBitmap();
// From KitKat onward use getAllocationByteCount() as allocated bytes can potentially be
// larger than bitmap byte count.
if (Utils.hasKitKat()) {
return bitmap.getAllocationByteCount();
}
if (Utils.hasHoneycombMR1()) {
return bitmap.getByteCount();
}
// Pre HC-MR1
return bitmap.getRowBytes() * bitmap.getHeight();
}