码迷,mamicode.com
首页 > 移动开发 > 详细

android 中如何获取camera当前状态

时间:2015-06-29 16:23:31      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

    /**
     * 测试当前摄像头能否被使用
     *
     * @return
     */
    public static boolean isCameraCanUse() {
        boolean canUse = true;
        Camera mCamera = null;
        try {
            // TODO camera驱动挂掉,处理??
            mCamera = Camera.open();
        } catch (Exception e) {
            canUse = false;
        }
        if(mCamera == null){
            canUse = false;
        }
        if (canUse) {
            mCamera.release();
            mCamera = null;
        }

        return canUse;
    }

  

android 中如何获取camera当前状态

标签:

原文地址:http://www.cnblogs.com/sishuiliuyun/p/4607613.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!