1

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

Om3ga
  • 26,989
  • 41
  • 135
  • 210

1 Answers1

1

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.

Imran Rana
  • 11,739
  • 7
  • 44
  • 51