With a press of a button, I want to play 44 mp3 files. It is working, but how can I exit with a click on a stop button? During playing all buttons seems to be blocked until the "For .. Next" sequence is ended.
B4X:
Sub btnPlay_Click
For i = 1 To 44 'Plays 44 mp3 files from 1.mp3 to 44.mp3
MediaPlayer2.Initialize( )
MediaPlayer2.Load(File.DirAssets, i & ".mp3")
MediaPlayer2.Play
Do While MediaPlayer2.IsPlaying = True 'Wait until the mp3 file has finished played until Next
Loop
MediaPlayer2.Release
If Ende = True Then 'With a click on the End button, I want to set "Ende" to True and exit,
Exit 'but it dosn't work
End If
Next
Ende = False
End Sub