Monday, July 11, 2011

[android-developers] Trying to listen for SCAN_MODE_CONNECTABLE_DISCOVERABLE

Hi

Im my Bluetooth calss I am trying to see when the device has finished
being 'Discoverable' When I listen for the ACTION_FOUND intent I get
the extra details by doing this:

BluetoothDevice device =
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

This gives me information about the device found. How to I retrieve
the SCAN_MODE_CONNECTABLE_DISCOVERABLE from the
ACTION_SCAN_MODE_CHANGED broadcast? I tried the same thing
(getParcelableExtra) but it doesn't work on type int only string.

if(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED.equals(action)) {
BluetoothAdapter adapter =
intent.getParcelableExtra(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE);
log("Scan Mode Changed!");
}

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment