首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >清除android中的蓝牙名称缓存

清除android中的蓝牙名称缓存
EN

Stack Overflow用户
提问于 2014-03-27 10:48:16
回答 1查看 2.4K关注 0票数 2

我要清理蓝光缓存。我在申请蓝牙。

我刚刚知道Android蓝牙设备的名字被缓存在电话里。(当电话找到蓝牙设备时)

我哪儿也找不到解决办法。我刚看到fetchUuidsWithSdp().有人说它清除了android手机中的蓝牙缓存。

但是我不知道如何使用这个方法,我也不认为fetchUuidsWithSdp()会清除缓存。

请告诉我如何清除Android中的蓝牙缓存,或者如何使用fetchUuidsWithSdp()。

谢谢:)

EN

Stack Overflow用户

发布于 2014-06-18 15:45:29

  1. 按照Android指南的指示开始发现。
  2. 在声明IntentFilter时,添加(至少) ACTION_FOUND和ACTION_UUID: filter.addAction(BluetoothDevice.ACTION_UUID);=新的IntentFilter(BluetoothDevice.ACTION_FOUND);
  3. 在接收方内部调用fetchUuidsWithSdp()。您将在ACTION_UUID中获得UUID: 公共onReceive(上下文、意图){ String = intent.getAction();if (BluetoothDevice.ACTION_FOUND.equals( action )) { //获取意图BluetoothDevice设备中的BluetoothDevice对象=BluetoothDevice // Get新鲜uidesdevice.fetchUuidsWithSdp();}否则,如果( intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);(Action)){ //获取设备和teh uuids设备=BluetoothDevice.ACTION_UUID.equals Parcelable[] uuidExtra = intent.getParcelableArrayExtra(BluetoothDevice.EXTRA_UUID);if(uuidExtra !=null){ for (Parcelable uuid : uuidExtra) { Log.d("YOUR_TAG",“设备:"+ device.getName() +”)“(”+ device.getAddress() +“)-服务:”+uuid.toString();}}“
票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22685285

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档