【发布时间】:2011-11-24 12:33:47
【问题描述】:
在我的应用程序中,我需要检查设备是否可发现以及蓝牙是打开还是关闭我应用了这样的代码
bluetoothenable=Settings.Secure.getInt(myContext.getContentResolver(),
android.provider.Settings.Secure.BLUETOOTH_ON);
当我在设置中检查蓝牙但可发现时,它提供了真正的价值 我添加此代码
bluetooth=Settings.System.getInt(myContext.getContentResolver(),
android.provider.Settings.System.BLUETOOTH_DISCOVERABILITY);
它给我设置未找到异常不是我检查的任何值
android.provider.Settings.System 如果我们无法读取设置值,则会出现此错误
android.provider.Settings.System?
【问题讨论】:
标签: android bluetooth settings