Android的LogCat中显示的消息多次,而不是一次 [英] Android LogCat displaying messages multiple times instead of once

查看:124
本文介绍了Android的LogCat中显示的消息多次,而不是一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作是连接到Web服务器,并从中获取数据流的项目。出于测试目的,我显示 LogCat中中的所有数据,所以我可以肯定,一切是正确的。

I'm working on a project which is connecting to web server and gets data stream from it. For testing purposes I'm showing all the data in LogCat so I can be sure that everything is right.

我在2设备上测试我的应用程序:

I'm testing my application in 2 devices:


  • HTC EVO 3D

  • HTC DESIRE。

在一个点上,我注意到一些奇怪的事情:当我在 EVO 3D 我看到,我得到的数据流中的所有数据包两次,这真的很奇怪测试因为服务器不能两次给我一个包。我想这是因为 EVO的双核心处理器。

At one point I noticed something strange: when I'm testing on EVO 3D I saw that I'm getting all packets of data stream twice, which is really strange because server cannot send me one packet two times. I thought it's because of EVO's dual core processor.

但在那之后我注意到的HTC Desire同样的问题仿真器太。在模拟器我甚至让所有的数据包三次。

But after that I noticed the same problem with HTC Desire and in emulator too. On emulator I'm getting all packets even three times.

的问题是,它不总是发生。我看了看这个问题密切,我看到 LogCat中正显示出两次或更多次在我的设备和仿真器的所有正在运行的进程,实际上我开始思考,它的 LogCat中的错误,并没有任何与我的应用程序。

The problem is that it's not always happening. I looked closer at that problem and I saw that LogCat is showing all running processes on my devices and emulator twice or more and actually I started thinking that it's LogCat bug and have nothing to do with my application.

所以我的问题:当别人越来越LogCat中同样奇怪的行为?它是一个SDK bug,或者问题是在我的应用程序code?

So my question: is anybody else getting the same strange behaviour of LogCat? Is it an SDK bug, or the problem is in my application code?

(我只是尝试与其他应用程序,结果是一样的)。

(I just tried with other applications, and the result is the same).

推荐答案

由于我注意到它可能是某种 LogCat中的bug,因为我调试我的code可能50次,发现没有什么可以重现这个问题。我做了检查请求到我送服务器。这是只有一个请求,而不是更多。所以这就是为什么我开始思考,它的可能是一个 LogCat中的bug。

As I noticed it's probably some kind of LogCat bug, because I debug my code maybe 50 times and find that there is nothing which can reproduce that problem. And I did check the request to the server which I am sending. It was only one request, not more. So that's why I started of thinking that it's probably an LogCat bug.

这篇关于Android的LogCat中显示的消息多次,而不是一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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