[英]Finding already playing ringtone
How can I find whether ringtone is already playing? 如何查找铃声是否已经在播放? If it is already playing then do not play it again.
如果已经在播放,则不要再播放。
You can use: 您可以使用:
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone ringtone = RingtoneManager.getRingtone(this, ringtoneUri);
And check whether ringtone is null or not and make decision accordingly. 并检查铃声是否为空 ,并据此做出决定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.