Reputation: 32941
How can I find whether ringtone is already playing? If it is already playing then do not play it again.
Upvotes: 1
Views: 147
Reputation: 11899
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.
Upvotes: 1