本文整理了Java中android.media.RingtoneManager.stopPreviousRingtone
方法的一些代码示例,展示了RingtoneManager.stopPreviousRingtone
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RingtoneManager.stopPreviousRingtone
方法的具体详情如下:
包路径:android.media.RingtoneManager
类名称:RingtoneManager
方法名:stopPreviousRingtone
暂无
代码示例来源:origin: ywwynm/EverythingDone
@Override
public void finish() {
mRingtoneManager.stopPreviousRingtone();
storeConfiguration();
super.finish();
}
代码示例来源:origin: consp1racy/android-support-preference
private void stopAnyPlayingRingtone() {
if (sPlayingRingtone != null && sPlayingRingtone.isPlaying()) {
sPlayingRingtone.stop();
}
sPlayingRingtone = null;
if (mDefaultRingtone != null && mDefaultRingtone.isPlaying()) {
mDefaultRingtone.stop();
}
if (mUnknownRingtone != null && mUnknownRingtone.isPlaying()) {
mUnknownRingtone.stop();
}
if (mRingtoneManager != null) {
mRingtoneManager.stopPreviousRingtone();
}
}
代码示例来源:origin: consp1racy/android-support-preference
@Override
public void onDialogClosed(boolean positiveResult) {
// Stop playing the previous ringtone
if (sPlayingRingtone == null) {
mRingtoneManager.stopPreviousRingtone();
}
// The volume keys will control the default stream
if (getActivity() != null) {
getActivity().setVolumeControlStream(AudioManager.USE_DEFAULT_STREAM_TYPE);
}
if (positiveResult) {
Uri uri;
if (mClickedPos == mDefaultRingtonePos) {
// Set it to the default Uri that they originally gave us
uri = mUriForDefaultItem;
} else if (mClickedPos == mSilentPos) {
// A null Uri is for the 'Silent' item
uri = null;
} else if (mClickedPos == mUnknownPos) {
// 'Unknown' was shown because it was persisted before showing the picker.
// There's no change to persist, return immediately.
return;
} else {
uri = mRingtoneManager.getRingtoneUri(getRingtoneManagerPosition(mClickedPos));
}
requireRingtonePreference().saveRingtone(uri);
}
}
内容来源于网络,如有侵权,请联系作者删除!