Ejemplo n.º 1
0
        private App()
        {
            Task.Run(() => {
                var context = Application.Context;

                // Start the service - since it's in our process.
                var intent = new Intent(context, typeof(LocationService));
                context.StartService(intent);

                // TODO: Demo3 - Step 5 - Bind to the service
                lsConnection = new LocationServiceConnection();
                lsConnection.ConnectionChanged += (s, e) => ConnectionChanged(this, e);
                context.BindService(intent, lsConnection, Bind.AutoCreate);
            });
        }
Ejemplo n.º 2
0
		private App()
		{
			Task.Run(() => {
				var context = Application.Context;

				// Start the service - since it's in our process.
				var intent = new Intent(context, typeof(LocationService));
				context.StartService(intent);

				// TODO: Demo3 - Step 5 - Bind to the service
				lsConnection = new LocationServiceConnection();
				lsConnection.ConnectionChanged += (s,e) => ConnectionChanged(this, e);
				context.BindService(intent, lsConnection, Bind.AutoCreate);
			});
		}