Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我设法将一个网页读入一个字符串,但是当我使用 Log.d() 将它打印到 LogCat 时,它总是显示比该页面上的实际内容少。
这使我怀疑以下一种(或多种)是可能的解释:
Android中的字符串有长度限制吗?
如果不是,有什么可能解释截断我的字符串?
它的 logcat 无法显示整个文本,将 logcat 的输出打印到文件中,我认为您应该能够看到整个字符串。
没错,Log.d() 将尾部截断超过某个 MAX_LENGTH,但是
System.out.println (string);
输出整个字符串。