2014-02-25 89 views
1

我嘗試在我的Android應用程序中實現BugSense,但我無法看到我提交的自定義數據。我真的找不到問題出在哪裏,因爲我收到錯誤報告,但沒有自定義數據。我實現了com.bugsense.trace.ExceptionCallback來接收「lastBreath」方法中所有未處理的異常。如何使用自定義數據正確使用BugSense?

這裏是我的示例代碼:

@Override 
public void lastBreath(Exception arg0) { 
    Log.w(TAG, "executing lastBreath"); 
    // adding current details to crash data 
    HashMap<String, String> errorDetails = new HashMap<String, String>(); 
    errorDetails.put("testKey", "testValue"); 
    errorDetails.put("testKey2", "testValue2"); 
    BugSenseHandler.sendExceptionMap(errorDetails, arg0); 
    Log.w(TAG, "lastBreath executed"); 
} 

這產生了一個錯誤報告,但我不知道在哪裏可以找到「密押」和「testKey2」的自定義值。我使用官方網站的示例代碼,那麼問題在哪裏?謝謝你的幫助。

回答

1

我正在做這個數據收集有點不同於你。以下是我的工作方式:

//Call the initAndStartSession right before the setContentView of your activity (onCreate method) 
BugSenseHandler.initAndStartSession(UserLogin.this, APIKEY); 
//Add the values that you need to monitor 
BugSenseHandler.addCrashExtraData("testKey", testKey); 
BugSenseHandler.addCrashExtraData("testKey2", testKey2); 

一旦發生錯誤,請轉到您的BugSense錯誤頁面。 (該鏈接應該類似於:https://www.bugsense.com/dashboard/project/YOUR_PROJECT_ID/errors/),然後單擊異常鏈接(如下圖所示)。

Errors Page

現在,一旦出錯頁面上,單擊「錯誤實例」

Error Instances

現在,如果你點擊扳手圖標,你會看到你的「密押」和「testKey2」可供顯示。 Last Step

希望它的作品!

相關問題