我正在开发一个使用android.hardware.Camera.parameters.getSupportedPictureSizes()这仅适用于SDK版本8,我希望与SDK4兼容,所以我这样做了:if(Build.VERSION.SDK_INT>=8){...}但是在模拟器上,它试图检查对该函数的引用,但失败了:02-0211:20:10.930:ERROR/dalvikvm(1841):Couldnotfindmethodandroid.hardware.Camera$Parameters.getSupportedPictureSizes,referencedfrommetho
除了Display.getOrientation()已弃用之外,Display.getRotation()和Display.getOrientation()之间还有什么区别?是否都返回等于Surface.ROTATION_0、Surface.ROTATION_90、Surface.ROTATION_180、Surface.ROTATION_270之一的int? 最佳答案 getRotation()只是调用已弃用的方法getOrientation(),检查sourcecodeofclassDisplay.所以它似乎只是为了一个更好的名
getRotation始终返回零,无论屏幕朝向哪个方向。我在运行2.3的真实设备上运行它。有什么理由吗?Displaydisplay=((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();introtation=display.getRotation(); 最佳答案 getRotation仅在应用具有UI并且允许UI旋转时才有效。操作系统有一个设置可以防止任何应用程序自动旋转:设置>显示>自动旋转屏幕这必须启用。在我