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);

 

 

关注公众号:Python爬虫数据分析挖掘,学习更多python知识

posted @ 2020-04-18 16:52  Python研究者  阅读(839)  评论(0编辑  收藏  举报