Code example for BluetoothAdapter

Methods: cancelDiscovery

0
 
    @Override 
    protected void onDestroy() { 
        super.onDestroy(); 
        if (mBluetoothAdapter != null) {
            mBluetoothAdapter.cancelDiscovery();
        } 
        unregisterReceiver(mReceiver);
    } 
 
    class NewDeviceClickListener implements OnItemClickListener {
        @Override 
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Intent data = new Intent();
            Device device = (Device) parent.getItemAtPosition(position);
            data.putExtra(EXTRA_DEVICE_ADDRESS, device.mAddress);
            setResult(RESULT_OK, data);
            finish();
        } 
    }