找不到蓝牙适配器操作

时间:2015-08-30 15:10:04

标签: android android-intent bluetooth broadcastreceiver intentfilter

我正在清单文件中静态注册广播接收器,我希望在启用连接时收到通知。我指的是android开发者网站here

它说我必须使用以下内容:

 Constant Value: "android.bluetooth.adapter.action.REQUEST_ENABLE" 

在我的清单文件中,我添加了以下内容,但没有任何名为REQUEST_ENABLE:

<action android:name="android.bluetooth.adapter.action.XXXX" >

请告诉我如何使用它。

2 个答案:

答案 0 :(得分:0)

如果你想知道何时打开/关闭蓝牙适配器,我认为你应该使用android.bluetooth.adapter.action.STATE_CHANGED。

为您提出的问题很多: 1.您是否可以尝试使用此权限定义(即使出现错误)并显示您的代码以及错误? 你在使用android studio,Eclipse吗? 3.什么是你的min / target / compile sdk版本(或Eclipse中的项目构建目标)

答案 1 :(得分:0)

如果您希望在连接时收到通知。您应该使用:

$("input").filter(function() {
  return $(this).attr("name").match(/width/i) !== null
})

如果您想收到有关转动/开启/关闭的状态,您应该使用:

<action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>