谁知道为什么
Intent pairIntent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
startActivityForResult(pairIntent, 0);
在所有三星设备上崩溃,但在模拟器、HTC、索尼、LG 等上运行良好。
已编辑------------------------------------
原来三星还需要 list 中的 BLUETOOTH_ADMIN
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
最佳答案
如果您有一个正在生产中的应用程序,您需要一些东西来获取崩溃日志。这可能是您通过 Play 商店或开源解决方案(如 ACRA)或任何数量的服务提供商发货时获得的默认内容。
关于您的崩溃,不能保证此 Activity 可用。引用 the documentation :
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
“安全措施”可能是将您的 startActivity()
调用包装在异常处理程序中,监视 ActivityNotFoundException
。
另外,请注意您使用的是 startActivity()
,而不是 startActivityForResult()
,用于此 Intent
操作。再次引用 the documentation :
Output: Nothing.
这意味着没有结果,使用startActivityForResult()
是在浪费时间。
关于android.provider.Settings.ACTION_BLUETOOTH_SETTINGS 在三星上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30006488/