I have an app with a button on it that I use to turn BT on and off. I have the following code in there;
public void buttonFlip(View view) { flipBT();
public void discoverBluetoothDevices(View view) { if (bluetoothAdapter!=null) bluetoothAdapter.startDiscovery(); Toast.makeText(this,"Start Discovery"+bluetoothAdapter.startDiscovery(),Toast.LENGTH_SHORT).show(); }