Code example for BluetoothAdapter

Methods: cancelDiscovery

0
	 
	@Override 
	public void onDestroy() { 
		timer.cancel();
		if(ba != null) {
			ba.cancelDiscovery();
			this.unregisterReceiver(br);
		} 
	} 
	 
    private final BroadcastReceiver br = new BroadcastReceiver() {
		@Override 
		public void onReceive(Context context, Intent intent) { 
			String action = intent.getAction(); 
			 
			if(BluetoothDevice.ACTION_FOUND.equals(action)) { 
				Log.v(SSC,"Bluetooth discovering..."); 
				BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); 
				bluetoothNeighbors.add(device.getName() + ";" + device.getAddress()); 
			} else if(BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) { 
				Log.v(SSC,"Bluetooth discovery finished.");