How to start, stop playing sound (ringtone) : Android -


i started playing sound using: (working)

ringtonemanager.getringtone(this, uri.parse(callerring)).play(); 

and trying stop playing sound using: (not working)

ringtonemanager.stoppreviousringtone(); 

any regarding problem appreciated.

thanks

ok. got answer own question. want share guys.

  1. create instance of ringtone as:

    ringtone ringtone; 
  2. get ringtone ringtonemanager using uri:

    ringtone = ringtonemanager.getringtone(this, uri.parse(ringtone_uri)); 
  3. start playing ringtone

    ringtone.play(); 
  4. stop playing ringtone

    ringtone.stop(); 

thats all. thank you


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -