This repository was archived by the owner on Aug 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
app/src/main/java/io/github/webbluetoothcg/bletestperipheral Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,8 @@ protected void onCreate(Bundle savedInstanceState) {
174174 mAdvStatus = (TextView ) findViewById (R .id .textView_advertisingStatus );
175175 mConnectionStatus = (TextView ) findViewById (R .id .textView_connectionStatus );
176176 mBluetoothDevices = new HashSet <>();
177- // TODO(g-ortuno): This can be moved to Peripherals.
178- ensureBleFeaturesAvailable ();
177+ mBluetoothManager = ( BluetoothManager ) getSystemService ( Context . BLUETOOTH_SERVICE );
178+ mBluetoothAdapter = mBluetoothManager . getAdapter ();
179179
180180 // If we are not being restored from a previous state then create and add the fragment.
181181 if (savedInstanceState == null ) {
@@ -303,9 +303,6 @@ public void run() {
303303 ////// Bluetooth //////
304304 ///////////////////////
305305 private void ensureBleFeaturesAvailable () {
306- mBluetoothManager = (BluetoothManager ) getSystemService (Context .BLUETOOTH_SERVICE );
307- mBluetoothAdapter = mBluetoothManager .getAdapter ();
308-
309306 if (mBluetoothAdapter == null ) {
310307 Toast .makeText (this , R .string .bluetoothNotSupported , Toast .LENGTH_LONG ).show ();
311308 Log .e (TAG , "Bluetooth not supported" );
You can’t perform that action at this time.
0 commit comments