I uploaded my sample project, can you Please do it for me
Replace all your Main activity code with the below code:
Sub Process_Globals
Private xui As XUI
Public mp As MediaPlayer
End Sub
Sub Globals
Private CheckPlay As Boolean = False
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
If FirstTime Then
mp.Initialize
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then mp.Stop
End Sub
Sub Button1_Click
If CheckPlay = False Then
mp.Load(File.DirAssets, "Active.mp3")
mp.Play
mp.Looping = True
Button1.Text = "Stop"
CheckPlay = True
Else
mp.Stop
Button1.Text = "Play"
CheckPlay = False
End If
End Sub
1. You mentioned that your project was B4Xpages, but it is not.
2. You were initializing the player in the button click event. That is not the place
3. mp should be declared in Process_Globals
4. When you ask for help, don't address your questions to just one person and make others feel unimportant.