1

I am working on a project related to Bluetooth. I wrote this sample code to detect Bluetooth in a device.

BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
if(bluetooth!=null)
{
    Toast.makeText(getApplicationContext(), "gfvhfh", Toast.LENGTH_LONG).show();
}

This code is working perfectly in my phone and displaying the text in toast, but in my system it's not showing anything. I am using a external Bluetooth adapter for my system.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
user1057197
  • 479
  • 1
  • 6
  • 15

1 Answers1

0

I guess that by system you mean emulator, in that case it is 100% normal. You can't use Bluetooth on the emulator as said here. Please check before asking a question that it hasn't been asked before!

Community
  • 1
  • 1
lc2817
  • 3,722
  • 16
  • 40