2012-08-02 71 views

回答

7

因爲你的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(); 
    } 
} 
+0

太棒了!謝謝!! – Rendy 2012-08-02 08:02:48

-1

把你的光標放在錯誤上,你會看到完整的log-cat信息。