Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何确定铃声是否已经在播放?如果它已经在播放,则不要再次播放。
您可以使用:
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone ringtone = RingtoneManager.getRingtone(this, ringtoneUri);
并检查铃声是否为空并做出相应的决定。