gpt4 book ai didi

安卓 CamcorderProfile.hasProfile NoSuchMethodError

转载 作者:行者123 更新时间:2023-11-30 04:08:56 25 4
gpt4 key购买 nike

我在尝试使用 CamcorderProfile.hasProfile(xyz) 时收到运行时 NoSuchMethodError。在我的应用 list 中指定了正确的 API

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />

这是我想使用的 block

CamcorderProfile cf = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_480P)) {
cf = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
} else if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_CIF)) {
cf = CamcorderProfile.get(CamcorderProfile.QUALITY_CIF);
} else if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_QVGA)) {
cf = CamcorderProfile.get(CamcorderProfile.QUALITY_QVGA);
}

我在 Eclipse 中编写/构建时没有遇到任何错误,甚至代码完成也能正常工作。编辑 此时我在一些设备(Galaxy、Incredible 和 Desire)上运行代码。

堆栈跟踪错误是

E/AndroidRuntime(12499): FATAL EXCEPTION: main
E/AndroidRuntime(12499): java.lang.NoSuchMethodError: Android.media.CamcorderProfile.hasProfile

任何提示为什么会发生这种情况?谢谢。

最佳答案

我认为布鲁诺是对的,这似乎是 API 级别的问题。

关于安卓 CamcorderProfile.hasProfile NoSuchMethodError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11139013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com