Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.MyButton);
            button.Click += button_Click;

            this.ApplicationContext.StartService(new Intent(this, typeof(ComputeFunction.ComputeService)));

            Intent serviceIntent = new Intent(this, typeof(ComputeFunction.ComputeService));
            IServiceConnection conn = new ComputeFunction.ServiceConnection(this);

            ApplicationContext.BindService(serviceIntent, conn, Bind.AutoCreate);
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.MyButton);

            button.Click += button_Click;

            this.ApplicationContext.StartService(new Intent(this, typeof(ComputeFunction.ComputeService)));

            Intent             serviceIntent = new Intent(this, typeof(ComputeFunction.ComputeService));
            IServiceConnection conn          = new ComputeFunction.ServiceConnection(this);

            ApplicationContext.BindService(serviceIntent, conn, Bind.AutoCreate);
        }