Skip to content

Instantly share code, notes, and snippets.

@sidishere
Created December 24, 2019 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidishere/1d2606e476eba45f09f3c794c96fe41a to your computer and use it in GitHub Desktop.
Save sidishere/1d2606e476eba45f09f3c794c96fe41a to your computer and use it in GitHub Desktop.
private void doDiscovery() {
Log.d("TAG", "doDiscovery()");
// Indicate scanning in the title
setProgressBarIndeterminateVisibility(true);
setTitle("discovering new devices");
// Turn on sub-title for new devices
findViewById(R.id.title_new_devices).setVisibility(View.VISIBLE);
// If we're already discovering, stop it
if (bluetoothAdapter.isDiscovering()) {
bluetoothAdapter.cancelDiscovery();
}
// Request discover from BluetoothAdapter
bluetoothAdapter.startDiscovery();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment