本文整理汇总了Java中android.media.AudioManager.STREAM_NOTIFICATION属性的典型用法代码示例。如果您正苦于以下问题:Java AudioManager.STREAM_NOTIFICATION属性的具体用法?Java AudioManager.STREAM_NOTIFICATION怎么用?Java AudioManager.STREAM_NOTIFICATION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.media.AudioManager
的用法示例。
在下文中一共展示了AudioManager.STREAM_NOTIFICATION属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVolType
private int getVolType(String type) {
switch (type) {
case VOL_VOICE_CALL:
return AudioManager.STREAM_VOICE_CALL;
case VOL_SYSTEM:
return AudioManager.STREAM_SYSTEM;
case VOL_RING:
return AudioManager.STREAM_RING;
case VOL_ALARM:
return AudioManager.STREAM_ALARM;
case VOL_NOTIFICATION:
return AudioManager.STREAM_NOTIFICATION;
default:
return AudioManager.STREAM_MUSIC;
}
}
示例2: initSeekBar
private void initSeekBar(SeekBar seekBar, Uri defaultUri) {
seekBar.setMax(mAudioManager.getStreamMaxVolume(mStreamType));
mOriginalStreamVolume = mAudioManager.getStreamVolume(mStreamType);
seekBar.setProgress(mOriginalStreamVolume);
seekBar.setOnSeekBarChangeListener(this);
// TODO: removed in MM, find different approach
mContext.getContentResolver().registerContentObserver(
System.getUriFor("volume_ring"),
false, mVolumeObserver);
if (defaultUri == null) {
if (mStreamType == AudioManager.STREAM_RING) {
defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
} else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
} else {
defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
}
}
mRingtone = RingtoneManager.getRingtone(mContext, defaultUri);
if (mRingtone != null) {
mRingtone.setStreamType(mStreamType);
}
}
示例3: applySound
private void applySound(Notification notification) {
if (sound == null) {
notification.sound = null;
} else {
notification.audioStreamType = AudioManager.STREAM_NOTIFICATION;
notification.sound = Uri.parse(sound);
}
}