作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在尝试使用 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/
我在尝试使用 CamcorderProfile.hasProfile(xyz) 时收到运行时 NoSuchMethodError。在我的应用 list 中指定了正确的 API 这是我想使用的 blo
我是一名优秀的程序员,十分优秀!