コード例 #1
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// load our layout
			SetContentView (Resource.Layout.CharacteristicListScreen);

			// find our controls
			this._listView = FindViewById<ListView> (Resource.Id.CharacteristicListView);
			this._serviceNameText = FindViewById<TextView> (Resource.Id.ServiceNameText);
			this._serviceIDText = FindViewById<TextView> (Resource.Id.ServiceIDText);

			this._serviceNameText.Text = "Service Name Unknown";
			this._serviceIDText.Text = App.Current.State.SelectedService.ID.ToString();

			// create our list adapter
			this._listAdapter = new CharacteristicsAdapter (this, App.Current.State.SelectedService.Characteristics);
			this._listView.Adapter = this._listAdapter;

			this.WireUpLocalHandlers ();
		}
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // load our layout
            SetContentView(Resource.Layout.CharacteristicListScreen);

            // find our controls
            this._listView        = FindViewById <ListView> (Resource.Id.CharacteristicListView);
            this._serviceNameText = FindViewById <TextView> (Resource.Id.ServiceNameText);
            this._serviceIDText   = FindViewById <TextView> (Resource.Id.ServiceIDText);

            this._serviceNameText.Text = "Service Name Unknown";
            this._serviceIDText.Text   = App.Current.State.SelectedService.ID.ToString();

            // create our list adapter
            this._listAdapter      = new CharacteristicsAdapter(this, App.Current.State.SelectedService.Characteristics);
            this._listView.Adapter = this._listAdapter;

            this.WireUpLocalHandlers();
        }
コード例 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_characteristics);
            characteristics = new List <BluetoothGattCharacteristic>();
            gatt            = SingleGattService.GetInstance().CurGatt;
            service         = SingleGattService.GetInstance().CurService;
            callBack        = SingleGattService.GetInstance().CurCallback;

            characteristicsList = FindViewById <GridView>(Resource.Id.characteristics_list);
            back = FindViewById <Button>(Resource.Id.characteristics_back);
            refreshCharacteristics  = FindViewById <Button>(Resource.Id.characteristics_refresh);
            stepintoCharacteristics = FindViewById <Button>(Resource.Id.characteristics_stepinto);

            adapter = new CharacteristicsAdapter(this, characteristics);
            characteristicsList.Adapter             = adapter;
            characteristicsList.OnItemClickListener = this;
            back.SetOnClickListener(this);
            refreshCharacteristics.SetOnClickListener(this);
            stepintoCharacteristics.SetOnClickListener(this);

            RefreshCharacteristics();
        }