Hello everyone, I just saw this error in the Play Console and I have no idea how to solve it.
Bad behavior - Stuck partial wake locks (background) - 0.24%
I think it has to be related to the PhoneWakeState and the Sub Activity_Resume or the Sub Activity_Pause in case someone knew how I could solve it.
Thanks
Bad behavior - Stuck partial wake locks (background) - 0.24%
I think it has to be related to the PhoneWakeState and the Sub Activity_Resume or the Sub Activity_Pause in case someone knew how I could solve it.
Thanks
B4X:
Sub Process_Globals
Dim PWS As PhoneWakeState
End Sub
Sub Globals
Dim AcSf As AcceleratedSurface
Dim SP As SoundPool
Dim MP_music_menu, MP_music_game As MediaPlayer
End Sub
Sub Activity_Resume
AcSf.StartRegularUpdateAndDraw(16)
PWS.KeepAlive(True)
If room = room_juego Then
If MP_music_game.IsPlaying = False Then
MP_music_game.Position = 0
MP_music_game.Play
MP_music_game.SetVolume(0.15, 0.15)
End If
Else If room = room_menu Then
If hay_musica = 1 Then
If MP_music_menu.IsPlaying = False Then
MP_music_menu.Position = 0
MP_music_menu.Play
MP_music_menu.SetVolume(0.09, 0.09)
End If
End If
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
AcSf.StopRegularDraw
PWS.ReleaseKeepAlive
If MP_music_menu.IsPlaying Then MP_music_menu.Pause
If MP_music_game.IsPlaying Then MP_music_game.Pause
If UserClosed Then
SP.Release
If MP_music_menu.IsPlaying Then MP_music_menu.Stop
If MP_music_game.IsPlaying Then MP_music_game.Stop
End If
End Sub