1

I have a problem circling around the Android Bluetooth Chat example found in the SDK samples. Whenever I connect a to a device and establish a connection, the ConnectedThread is being executed, everything is sweet, the System Dialog pops up askig me to tick in the PIN to pair. However, when I click the cancel button on that partiuclar dialog, I want to react on that. Since I rely and also want to rely on a non-custom dialog, I realy wonder how I can fetch the dismiss event on that particular dialog.

Regards, Simon

John Smith
  • 752
  • 9
  • 35
  • you should always provide the code you are using (even though it is found in an SDK) to show where the problem is and have the people look at what could be wrong – HpTerm Nov 21 '12 at 13:07

2 Answers2

3

Just add this line in your code where you want dialog to dismiss.

Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(intent);
droidd
  • 1,361
  • 10
  • 15
0

You can do pairing programmatically to avoid this. You may refer Link1 and Link2

Community
  • 1
  • 1
kittu88
  • 2,451
  • 5
  • 40
  • 80
  • 1
    Thanks for the reply, digging in there. Maybe I can come up with a workaroud. However, intentionally I do not want to avoid this, I want to react on the user action when he presses dismiss. However, as stated in your 2nd link, there seems to be no way to receive any type of event when tabbing cancel... Or am I overlooking something? If that is the case, I have just one more reason to hate the SDK =) – John Smith Nov 21 '12 at 13:19