如何在didRangeBeaconsInRegion中显示数据库中的数据?(How to Display data from the database in didRangeBeaconsInRegi

编程入门 行业动态 更新时间:2024-10-27 02:30:47
如何在didRangeBeaconsInRegion中显示数据库中的数据?(How to Display data from the database in didRangeBeaconsInRegion?)

当在特定距离内检测到信标时,我想从数据库向textview显示数据....问题是它不起作用或不显示任何内容这里是我的代码...

public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) { if (beacons.size() > 0) { for (Beacon beacon: beacons) { if(beacon.getDistance() < 0.5){ ddb(); //Call Display data from database }

它与每秒的范围有关吗?

是否可以使用didRangeBeaconsInRegion显示数据库中的数据?

I want to display data to the textview from the database when the beacon is detected in specific distance .... the problem is it does not work or does not display anything here's my code ...

public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) { if (beacons.size() > 0) { for (Beacon beacon: beacons) { if(beacon.getDistance() < 0.5){ ddb(); //Call Display data from database }

Does it has something to do with ranging every second?

Is it possible to display data from the database using didRangeBeaconsInRegion?

最满意答案

尝试添加日志行以进行故障排除,如下所示:

for (Beacon beacon: beacons) { Log.d(TAG, "saw beacon:"+beacon+" with dist "+beacon.getDistance() ); if(beacon.getDistance() < 0.5) { Log.d(TAG, " calling ddb"); ddb(); //Call Display data from database } }

检查您是否看到第一个日志行,并验证如果距离小于0.5,则显示第二个日志行。

Try adding log lines to troubleshoot like this:

for (Beacon beacon: beacons) { Log.d(TAG, "saw beacon:"+beacon+" with dist "+beacon.getDistance() ); if(beacon.getDistance() < 0.5) { Log.d(TAG, " calling ddb"); ddb(); //Call Display data from database } }

Check to see that you see the first log line, and verify that if the distance is less than 0.5 the second log line is shown.

更多推荐

本文发布于:2023-08-02 19:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1380625.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库中   数据   如何在   didRangeBeaconsInRegion   database

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!