Notice
Recent Posts
Recent Comments
Link
투케이2K
629. (Android/Java) [Android 13] 안드로이드 AudioManager 사용해 알림 볼륨 UP , DOWN 수행 - STREAM_NOTIFICATION 본문
Android
629. (Android/Java) [Android 13] 안드로이드 AudioManager 사용해 알림 볼륨 UP , DOWN 수행 - STREAM_NOTIFICATION
투케이2K 2023. 8. 24. 20:24[개발 환경 설정]
개발 툴 : AndroidStudio
[소스 코드]
// -----------------------------------------------------------------------------------------
// TODO [SEARCH FAST] : [알림 볼륨 UP]
// -----------------------------------------------------------------------------------------
public static void setNotiVolumeUP(Context mContext) {
try {
// ===============================================================
S_Log._D_("알림 볼륨 UP 이벤트 지정", null);
// ===============================================================
AudioManager mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
mAudioManager.adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI);
}
catch (Exception e){
e.printStackTrace();
}
}
// -----------------------------------------------------------------------------------------
// TODO [SEARCH FAST] : [알림 볼륨 DOWN]
// -----------------------------------------------------------------------------------------
public static void setNotiVolumeDOWN(Context mContext) {
try {
// ===============================================================
S_Log._D_("알림 볼륨 DOWN 이벤트 지정", null);
// ===============================================================
AudioManager mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
mAudioManager.adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI);
}
catch (Exception e){
e.printStackTrace();
}
}
반응형
'Android' 카테고리의 다른 글
Comments