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