Android关闭自定义相机快门声

 
        AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
        audioManager.setStreamMute(AudioManager.STREAM_SYSTEM, true);
        // 消除拍照声音
        final Handler soundHandler = new Handler();
        Timer t = new Timer();
        t.schedule(new TimerTask() {
            @Override
            public void run() {
                soundHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
                        audioManager.setStreamMute(AudioManager.STREAM_SYSTEM, false);
                    }
                });
            }
        }, 1000);

 

Android关闭自定义相机快门声

上一篇:Android Studio安装


下一篇:Web测试与APP测试有哪些异同?