简体   繁体   中英

Android Dismiss System Dialog

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

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

Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(intent);

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM