public override void OnResume() { base.OnResume(); resetLiveView(); enableBLView(); sentTimeUpdate.Enabled = true; disableSwitch(); if (AppConfig.PostSensorUpdates) { _scanSwitch.Checked = true; } else { _scanSwitch.Checked = false; } enableSwitch(); // Populating list view with already connected devices populateConnectedDeviceList(); if (!AppUtil.checkIfBluetoothEnabled(_adpt)) { // Bluetooth not enabled Toast.MakeText(appContext, NO_BLUETOOTH_WARNING, ToastLength.Short).Show(); Log.Error(TAG, "Bluetooth could not be enabled"); disableBLView(); } // radioGroupList.ClearCheck(); }
/// <summary> /// Checks that the bluetooth device is connected when resuming /// </summary> protected override void OnResume() { base.OnResume(); onResumeUI(); if (AppUtil.checkIfBluetoothEnabled(_adpt)) { addBoundedDevices(); _worker.RunWorkerAsync(); } else { // Bluetooth not enabled Toast.MakeText(appContext, NO_BLUETOOTH_WARNING, ToastLength.Short).Show(); } }
/// <summary> /// UI changes needed onResume /// </summary> private void onResumeUI() { myAct.RunOnUiThread(delegate { // Clearing the List Views and enabling the list views clearPairedDeviceListView(); clearNewDeviceListViews(); setPairedDeviceListViewClick(true); setNewDeviceListViewClick(true); // Setting Visibility for the load dial setLoadDialVisibility(false); // If the bluetooth is enabled, set the UI appropietly if (AppUtil.checkIfBluetoothEnabled(_adpt)) { // Enabling button scanButton.Enabled = true; } }); }