Hello!
When trying to use code example from bluetooth tutorial (http://
developer.android.com/guide/topics/wireless/bluetooth.html) I get get
following behavior.
Staring Bluetooth chat sample with Bluetooth turned off:
Intent enableIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
in onActivityResult I get opposite resultCode for what I've done:
public void onActivityResult(int requestCode, int resultCode,
Intent data) {
if(D) Log.d(TAG, "onActivityResult " + resultCode);
switch (requestCode) {
case REQUEST_CONNECT_DEVICE:
if (D) Log.d ("Bluetooth request connect resultCode: " +
resultCode);
break;
.............
}
}
If I agree to enable Bluetooth, the request code is 0
(Activity.RESULT_CANCELED). If I answer 'no' and don't enable the
device I get -1 (Activity.RESULT_OK)
What am I doing wrong, what do I miss? How can I report a bug?
Sergey Kruk