Dim MB As MediaBrowser
...
'--- start play as service
playService.MB = MB
playService.ID_AudioFile = playButton.Tag
StartService(playService)
PlayService:
B4X:
Sub Process_Globals
Dim MB As MediaBrowser
Dim ID_AudioFile As Int
End Sub
Sub Service_Start (StartingIntent As Intent)
'--- play file
MB.MediaAudioPlay(True, ID_AudioFile)
End Sub
Sub Service_Destroy
MB.MediaStop
End Sub
But when i rotate screen now the music continues to play, but if user click on other song, STARTS 2 SERVICES and the 2 songs overlap...! can i control if service is active and kill it before start new service? (should play only the last selected song)