相关疑难解决方法(0)

无法解析符号KITKAT无法解析方法getAllocationByteCount()

我正在尝试运行"BitmapFun"官方示例,但收到以下错误:

1)无法解析符号KITKAT 2)无法解析方法getAllocationByteCount()

有帮助吗?

我的AndroidManifest.xml:

<uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="19" />
Run Code Online (Sandbox Code Playgroud)

这是代码:

 @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();
}
Run Code Online (Sandbox Code Playgroud)

android

5
推荐指数
1
解决办法
8353
查看次数

Android Studio中的所有导入错误

在此输入图像描述

昨天,我的孩子已经通过直接从墙上电源拔掉我的电脑了.当我今天推出Android Studio时,如图所示......

在此输入图像描述

我试过了:

  • 检查SDK位置.
  • 重建项目.
  • 重启Android Studio.
  • 同步项目的gradle文件.

任何帮助?

android android-studio

5
推荐指数
2
解决办法
3163
查看次数

标签 统计

android ×2

android-studio ×1