I was able to reproduce it on Galaxy Tab which runs Android 2.3. As jota wrote it doesn't happen on newer versions.
It seems like a bug in Android which causes the activity to be recreated in this case.
Mediaplayer solution for android 2.3 and 2.1
but gives errors in the transitions
There were two tablet that gave the error
The solution is the library Phone
#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: Media Player
#VersionCode: 1
#VersionName:
#SupportedOrientations: landscape
#CanInstallToExternalStorage: True
#End Region
'*************************LEER***************************** Si se coloca la Orientacion en portrait se corrige el error
'*************************LEER*****************************
Sub Process_Globals
Dim MediaPlayer1 As MediaPlayer
End Sub
Sub Globals
Dim phn As Phone' Solucion
Dim button1 As Button
Dim Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
phn.SetScreenOrientation(0) ' Solucion
Activity.LoadLayout("1")
If FirstTime Then
MediaPlayer1.Initialize( )
MediaPlayer1.Load(File.DirAssets, "IsawHerStandingThere.mid")
End If
MediaPlayer1.Looping = True
End Sub
Sub Activity_Resume
phn.SetScreenOrientation(1)' Solucion
MediaPlayer1.Play
End Sub
Sub Activity_Pause (UserClosed As Boolean)
phn.SetScreenOrientation(1)' Solucion
UserClosed = False
If MediaPlayer1.IsPlaying Then MediaPlayer1.Pause
End Sub
Sub Button1_Click
Activity.Finish
ExitApplication
End Sub
**********************************************
Last question and I stop the transition effect of the Activity Modules