I have a service:
[Service]
public class LocationService : Service, ILocationListener
{
....
public override StartCommandResult OnStartCommand(...)
{ return StartCommandResult.Sticky; }
}
Started in one of environment
new Task(() =>
{
Application.Context.StartService(new Intent(Application.Context, typeof(LocationService)));
}).Start();
How to stop this service from another place?
I tried to do this:
Application.Context.StopService(new Intent(Application.Context, typeof(LocationService)));
but it does not always work