80,351
社区成员
发帖
与我相关
我的任务
分享
/** A safe way to get an instance of the Camera object. */
public static Camera getCameraInstance(){
Camera c = null;
try {
c = Camera.open(); // attempt to get a Camera instance
}
catch (Exception e){
// Camera is not available (in use or does not exist)
}
return c; // returns null if camera is unavailable
}
catch里做失败处理
http://www.android-doc.com/guide/topics/media/camera.html