Reputation:
I started playing sound by using: (Working)
RingtoneManager.getRingtone(this, Uri.parse(callerRing)).play();
And trying to stop playing sound using: (Not working)
ringtoneManager.stopPreviousRingtone();
Any help regarding this problem will be much appreciated.
Thanks
Upvotes: 1
Views: 3395
Reputation:
Ok. I got answer for my own question. So I want to share it with you guys.
Create instance of Ringtone
as:
Ringtone ringtone;
Get ringtone from RingtoneManager
using Uri
:
ringtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone_uri));
Start playing ringtone
ringtone.play();
Stop playing ringtone
ringtone.stop();
Thats all. Thank you
Upvotes: 5