I have tried different things but unsure what is going wrong, I get this error when I start this specific service.
Service intent must be explicit: Intent { act=com.xamarin.action.PLAY(has extras) }
I am passing a string ID when starting the service as following
var intent = new Intent(MediaService.ActionPlay);
intent.PutExtra("ID", ID);
StartService(intent); // Error here
My service looks something like the following
[Service]
[IntentFilter(new[] { ActionPlay, ActionPause, ActionStop })]
public class MediaService: Service
{
public const string ActionPlay = "com.xamarin.action.PLAY";
public const string ActionPause = "com.xamarin.action.PAUSE";
public const string ActionStop = "com.xamarin.action.STOP";
public override StartCommandResult OnStartCommand(Intent intent,
StartCommandFlags flags, int startId)
{
switch (intent.Action)
{
case ActionPlay: Play(intent.GetStringExtra("ID")); break;
case ActionStop: Stop(); break;
case ActionPause: Pause(); break;
}
}
}
Where the play action is the following
public bool Play(string playID)
{
....
}
What am i doing wrong.