话不多说 直接上代码,
@SuppressLint("NewApi")
public static boolean isSupportFrontCamera() {
if (!hasGingerbread()) {
return false;
}
@SuppressWarnings("deprecation")
int numberOfCameras = android.hardware.Camera.getNumberOfCameras();
if (2 == numberOfCameras) {
return true;
}
return false;
}
public static boolean hasGingerbread() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD;
}
搞定
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-30 00:32:54