Sub PlaySpotify
Dim SpotIsPlaying1 As Boolean 'ditto
Dim R As Reflector
R.Target = R.GetContext
R.Target = R.RunMethod2("getSystemService","audio","java.lang.String")
SpotIsPlaying1 = R.RunMethod("isMusicActive")
Log("Start Spotify : playing=" & SpotIsPlaying1)
If SpotIsPlaying1 == True Then Return
If bSpotify Then
Si.SendKeyCode(KeyCodes.KEYCODE_MEDIA_PLAY_PAUSE)
Sleep(0)
End If
End Sub
Sub StopSpotify
Dim SpotIsPlaying1 As Boolean 'ditto
Dim R As Reflector
R.Target = R.GetContext
R.Target = R.RunMethod2("getSystemService","audio","java.lang.String")
SpotIsPlaying1 = R.RunMethod("isMusicActive")
Log("Stop Spotify : playing=" & SpotIsPlaying1)
If SpotIsPlaying1 == False Then Return
If bSpotify Then
Si.SendKeyCode(KeyCodes.KEYCODE_MEDIA_STOP)
Sleep(0)
End If
End Sub
Sub RunSpotify
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "spotify:track:0")
i.SetComponent("com.spotify.mobile.android.ui")
StartActivity(i)
End Sub