关于关闭背景音乐的feature,可以在对应的APP中添加如下代码:
AudioManager manager=(AudioManager)getSystemService(AUDIO_SERVICE);
// acquire the audio system service
manager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);//set volume of music stream
播放tone音可以通过如下方法:
Uri ring = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
//acquire the uri of ringtone
Ringtone ringtone=RingtoneManager.getRingtone(this, ring);
ringtone.play();//start to play
AudioManager manager=(AudioManager)getSystemService(AUDIO_SERVICE);
// acquire the audio system service
manager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);//set volume of music stream
播放tone音可以通过如下方法:
Uri ring = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
//acquire the uri of ringtone
Ringtone ringtone=RingtoneManager.getRingtone(this, ring);
ringtone.play();//start to play