using Android.Content; namespace Tesses.YouTubeDownloader.Droid; [BroadcastReceiver] public class TYTDReceiver : BroadcastReceiver { public const string RECEIVER_KEY="tytdRequest"; public const int COMMAND_CLOSE_SERVER = 0; public override void OnReceive(Context? context, Intent? intent) { if(intent == null) return; int reqId = intent.GetIntExtra(RECEIVER_KEY,-1); if(reqId == -1) return; switch(reqId) { case COMMAND_CLOSE_SERVER: TYTDCommon.Close(); if(context != null){ Intent? intent1= new Intent(context,typeof(TYTDServerService)); context.StopService(intent1); } break; } } }