Om3ga
Om3ga

Reputation: 32941

Finding already playing ringtone

How can I find whether ringtone is already playing? If it is already playing then do not play it again.

Upvotes: 1

Views: 147

Answers (1)

Imran Rana
Imran Rana

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

Related Questions