728x90

[Android] Volume Control 하는방법 및 예제소스 Android Develop

2010/12/23 16:30

복사 http://blog.naver.com/neocold/90102798676

전용뷰어 보기

 안드로이드 볼륨 컨트롤 및 예제 소스~

 

Media Volume (Music/Video etc…)

this.setVolumeControlStream(AudioManager.STREAM_MUSIC);  

 

Ringtone Volume

this.setVolumeControlStream(AudioManager.STREAM_RING);  

 

Alarm Volume

this.setVolumeControlStream(AudioManager.STREAM_ALARM);  

 

Notification Volume

this.setVolumeControlStream(AudioManager.STREAM_NOTIFICATION);  

 

System Volume

this.setVolumeControlStream(AudioManager.STREAM_SYSTEM);  

 

Voicecall Volume

this.setVolumeControlStream(AudioManager.STREAM_VOICECALL);  
 
사용위치
onResume()

AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);

// audioManager.setStreamVolume(볼륨컨트롤, 뷰륨크기, 볼륨상태(audioManager.FLAG...으로 시작하는 인자들...) );

audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 0);

 

728x90

+ Recent posts