Oreo, BLE scanner startScan with PendingIntent not working on Samsung device

前端 未结 3 1626
感动是毒
感动是毒 2021-02-11 09:41

I am trying to scan for beacons using startScan(filters, settings, callbackIntent). I have an implementation that works fine for Sony Xperia XZ, and Nexus 5X. The only other dev

3条回答
  •  时光说笑
    2021-02-11 10:22

    You need to pass an empty filters list to the startScan() call instead of null

    List listOfFiters = new ArrayList<>();
    ScanFilter.Builder builder = new ScanFilter.Builder();
    ScanFilter filter = builder.build();
    listOfFiters.add(filter);
    
    bleScanner.startScan(listOfFilters, null, getPendingIntent())
    

提交回复
热议问题