1
任何人都知道为什么Logcat不显示完整的消息? 我尝试打印从我的网站的XML响应,但我只能得到一些吧..为什么LogCat不显示完整的消息?
任何人都知道为什么Logcat不显示完整的消息? 我尝试打印从我的网站的XML响应,但我只能得到一些吧..为什么LogCat不显示完整的消息?
因为你的logcat已达到其最大大小,见What is the size limit for Logcat and how to change its capacity?
尝试使用此代码到你的结果写入到一个文本文件SD卡,然后使用DDMS得到它。
public static void appendLog(String text)
{
File logFile = new File("sdcard/log.txt");
if (!logFile.exists())
{
try
{
logFile.createNewFile();
} catch (IOException e)
{
e.printStackTrace();
}
}
try
{
// BufferedWriter for performance, true to set append to file flag
BufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true));
buf.append(text);
buf.newLine();
buf.close();
} catch (IOException e)
{
e.printStackTrace();
}
}
把你的光标放在错误上,你会看到完整的log-cat信息。
太棒了!谢谢!! – Rendy 2012-08-02 08:02:48