How can I find whether ringtone is already playing? If it is already playing then do not play it again.
Asked
Active
Viewed 138 times
1
-
http://stackoverflow.com/questions/1271777/how-to-set-ringtone-in-android-from-my-activity – Kazekage Gaara May 13 '12 at 05:29
-
It doesnt show how to find whether ringtone is playing currently or not. – Om3ga May 13 '12 at 05:37
-
1maybe this might help : http://stackoverflow.com/questions/2092470/android-detect-which-ringtone-is-actually-playing-ringtone-isplaying-problem – Kazekage Gaara May 13 '12 at 05:40
1 Answers
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,899
- 7
- 45
- 51