android - 蓝牙权限请求对话框 - 在屏幕旋转时重新创建(方向更改)

标签 android bluetooth android-alertdialog device-orientation

我使用了以下代码来启用蓝牙 ( as described here ) 并且在我的应用程序启动器 Activity 的 onCreate() 中运行了相同的代码 -

Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, 101);

现在的问题是当弹出这个对话框时,每次我旋转设备时,都会在之前创建的对话框之上再次创建该对话框。

我通过从 list 中处理它来防止重新创建我的 Activity

android:configChanges="orientation|screenSize|keyboardHidden"

这不会发生在所有设备上 我正在接受这个: LG Nexus 5、三星 Galaxy Grand

而不是: 三星 I9500 盖乐世 S4

编辑: 找到此报告的问题但找不到解决方案 Here is the link

创建了另一个问题 Here

最佳答案

看来这个错误一直没有解决!!
我已经在包括最新的 Pixel device 在内的多个设备上对此进行了测试它仍然存在
code.google.com/p/android 上多次提出同样的问题

引用提出的问题:
Issue 60002: Bluetooth permission request dialog

Issue 219105 On each rotation, dialog for requesting user permission to enable Bluetooth, the request dialog is placed on the top of the stack

Issue 24931: Bluetooth permission request dialog - recreated on screen rotation(orientation change)


如果有人找到解决方案,请在此处发布

关于android - 蓝牙权限请求对话框 - 在屏幕旋转时重新创建(方向更改),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38739407/

相关文章:

android - 无法使用 BitmapFactory.decodeStream() 从 Url 加载图像

android - API/数据源 - 链接和按使用付费

安卓 : how to execute AsyncTask?

android - 无法取消选中 setMultiChoiceItems 中的 selectedItems

java - 如何在一个字符串中存储多个单词而不替换java中的旧单词

ios - 如果蓝牙关闭 iOS,禁用警告对话框

java - 我想知道BLE gatt设置的完成时间(如回调)

android:如何确保我的应用程序在后台运行时不会暂停

android - 在 alertDialog 中使用微调器时出现空指针异常

Android,当应用程序打开时显示 alertDialog 而不是通知