标签:android packagemanager 相机 camera
通过PackageManager可以判断android设备是否有相机!
PackageManager pm = getPackageManager(); // FEATURE_CAMERA - 后置相机 // FEATURE_CAMERA_FRONT - 前置相机 if (!pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) && !pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) { Log.i("camera", "non-support"); } else { Log.i("camera", "support"); }
标签:android packagemanager 相机 camera
原文地址:http://blog.csdn.net/chadeltu/article/details/44244153