コード例 #1
0
        public override bool OnStartJob(JobParameters @params)
        {
            this.parameters = @params;
            Toast.MakeText(
                this,
                @params.Extras.GetString("message"), ToastLength.Short)
            .Show();

            //Task.Run(() =>
            //{
            //    for(int i = 0; i < 10; i++)
            //    {
            //        Thread.Sleep(3000);
            //        MainThread.BeginInvokeOnMainThread(() => Toast.MakeText(
            //            this,
            //            $"Downloading {i} files...",
            //            ToastLength.Long).Show());
            //    }

            //    JobFinished(@params, true);
            //});

            wThread = new ExecuteWorkerThreadWork();
            wThread.ExecuteLongRunningTask(this);

            JobFinished(@params, true);
            return(true);
        }
コード例 #2
0
 public override bool OnStopJob(JobParameters @params)
 {
     wThread = null;
     return(true);
 }