2014-09-23 59 views

回答

0

,我發現這一點,在我的項目中使用它:

private void uncaughtExceptionHandler() { 
     Thread.UncaughtExceptionHandler myHandler = new ExceptionReporter(easyTracker, 
       GAServiceManager.getInstance(), 
       Thread.getDefaultUncaughtExceptionHandler(), this); 

     // Make myHandler the new default uncaught exception handler. 
     Thread.setDefaultUncaughtExceptionHandler(myHandler); 
    } 

,你必須調用的onCreate這個方法:

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 

    easyTracker = EasyTracker.getInstance(this); 

    uncaughtExceptionHandler(); 

    // 
} 
+0

這看起來並不像v4的代碼,它看起來像任v3或v2。 – user2768 2014-12-08 19:31:46

相關問題