I made the below CurrentLocationTask as a way of reducing code duplication, as my application currently has 2 different Activitys which both use GoogleApiClient and OnLocationChanged.The task basically connects a GoogleApiClient, then uses a LocationRequest to subscribe to RequestLocationUpdates.In the OnLocationChanged method, CurrentLocation is updated, and the PropertyChanged event is fired.Because the PropertyChangedEventHandler is public, it can be subscribed to from the required Activity. So the task can be called from an Activity on which we need to get the user's current location.UsageOnCreateCreate a new CurrentLocationTask and Execute, passing in the current activity as context. Then subscribe to the PropertyChanged event with OnCurrentLocationChanged:protected override void OnCreate(Bundle bundle){    base.OnCreate(bundle);    SetContentView(Resource.Layout.Main);    // Subscribe to current location    _currentLocationTask = new CurrentLocationTask();    _currentLocationTask.Execute(this);    _currentLocationTask.PropertyChanged += OnCurrentLocationChanged;}OnCurrentLocationChangedWe can get CurrentLocation from the CurrentLocationTask:private void OnCurrentLocationChanged(object sender, PropertyChangedEventArgs e){    _currentLocation = _currentLocationTask.CurrentLocation;}OnStopIn OnStop, Disconnect the GoogleApiClient:protected override void OnStop(){    base.OnStop();    _currentLocationTask.Client.Disconnect();}The code for the AsyncTask is below. Any recommendations are much appreciated. I'm not sure if using AsyncTask is the best way of doing this, especially since I don't think very much of the code here is actually being called in RunInBackground.CurrentLocationTaskusing System.Linq;using System.ComponentModel;using Android.OS;using Android.Gms.Common.Apis;using Android.Gms.Common;using Android.Gms.Location;using Android.Locations;using Android.Content;namespace WeatherApp.Droid{    class CurrentLocationTask :         AsyncTask<Context, int, Java.Lang.Void>,        GoogleApiClient.IConnectionCallbacks,        GoogleApiClient.IOnConnectionFailedListener,        Android.Gms.Location.ILocationListener,        INotifyPropertyChanged    {        public event PropertyChangedEventHandler PropertyChanged;        public Location CurrentLocation { get; set; }        public GoogleApiClient Client;        private LocationRequest _locationRequest;        private Context _context;        // AsyncTask        protected override Java.Lang.Void RunInBackground(params             Context[] context)        {            _context = context.First();            // Build the client and connect            Client =                 new GoogleApiClient.Builder(_context)                .AddApi(LocationServices.API)                .AddConnectionCallbacks(this)                .Build();            Client.Connect();            return null;        }        // API connection        public void OnConnected(Bundle connectionHint)        {            _locationRequest = LocationRequest.Create();            _locationRequest.SetPriority(LocationRequest.PriorityHighAccuracy);            _locationRequest.SetInterval(1000);            LocationServices.FusedLocationApi.RequestLocationUpdates(                Client, _locationRequest, this);        }        public void OnConnectionFailed(ConnectionResult result)        {            MessageBox.Show(_context, Connection Failed);        }        public void OnConnectionSuspended(int cause)        {            MessageBox.Show(_context, Connection Suspended);        }        // Location changed        public void OnLocationChanged(Location location)        {            CurrentLocation = location;            PropertyChanged?.Invoke(this,                new PropertyChangedEventArgs(CurrentLocation));        }    }}
AsyncTask for subscribing to current location
c#;android;asynchronous;google maps;xamarin