Android Question Stop a ringtone

sixvoz

Member
Licensed User
Longtime User
Hi, can someone give me info and sample on how stop a ringtone?
B4X:
   Dim jo As JavaObject
   jo.InitializeStatic("android.media.RingtoneManager")
   Dim jo2 As JavaObject
   jo2.InitializeContext
   Dim u As Uri
   u.Parse(rm.GetDefault(rm.TYPE_RINGTONE))
   ringtone =jo.RunMethodJO("getRingtone", Array(jo2, u))
   'jo.RunMethod("stopPreviousRingtone", Null)
   ringtone.RunMethod("stop", Null)

This Not stop the ringtone.

Help please.

Thank you.
 

KMatle

Expert
Licensed User
Longtime User

Just use only

B4X:
ringtone.RunMethod("stop", Null)

Important: Must be the same ringtone object which started the ringtone to play (NOT a new instance which you have created here).
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…