I am trying to move the MediaPlayer in my app into a service, but it is giving a compiliation error....
I am declaring it here....
.... and trying to initialize it here....
What am I doing wrong?
B4X:
Compiling code. Error
Error compiling program.
Error description: Object reference not set to an instance of an object.
Occurred on line: 22
mediaPlayer1.Initialize("MP")
Word: (
I am declaring it here....
B4X:
'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim mediaPlayer1 As MediaPlayer
B4X:
Sub Service_Create
mediaPlayer1.Initialize("MP")
End Sub
What am I doing wrong?