TrafficStats函数总是返回-1 [英] TrafficStats functions always return -1

查看:238
本文介绍了TrafficStats函数总是返回-1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用TrafficStats类检索的流量数据,

When i try to retrieve traffic data using TrafficStats class,

TrafficStats.getTotalRxBytes() TrafficStats.getTotalTxBytes()函数总是返回-1,即使我使用浏览器加载一些网页。

TrafficStats.getTotalRxBytes() and TrafficStats.getTotalTxBytes() functions always return -1 even if i use the browser to load some web pages.

我知道一些论坛,-1表示该设备不支持的行动。我用了WVGA,NEXUS ONE和Nexus S和问题仍然存在。

I knew from some forums that -1 mean that the device don't support the action. I used WVGA, NEXUS ONE and NEXUS S and the problem persists.

感谢你。

推荐答案

可能无法正常工作。尝试真正的设备上。

If you are using emulator it might not work. Try on a real device.

这篇关于TrafficStats函数总是返回-1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆