谷歌Analytics(分析)的Andr​​oid SDK /异常报告:" myParser重新presents您ExceptionParser&QUOT的执行情况; [英] Google Analytics Android SDK / Exceptions report : "myParser represents your implementation of ExceptionParser"

查看:83
本文介绍了谷歌Analytics(分析)的Andr​​oid SDK /异常报告:" myParser重新presents您ExceptionParser&QUOT的执行情况;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目已经实施了谷歌Analytics(分析)的异常报告功能(Android SDK中)这里描述:

I have implemented in my project the exception reporting feature of Google Analytics (Android SDK) described here :

https://developers.google.com/analytics/devguides/collection/android/v2/exceptions?hl=fr

我想用ExceptionParser作为页面的底部,解释,但我不明白他们的意思是:

I would like to use ExceptionParser as explained at the bottom of the page but I don't understand what they mean by :

// Where myParser represents your implementation of ExceptionParser.
ExceptionParser parser = new myParser(context);

我应该写在myParser类?为什么这个类是不是谷歌Analytics(分析)SDK的一部分吗?

What should I write in the myParser class ?? Why this class is not part of the Google Analytics SDK ?

谢谢!

推荐答案

他们说, ExceptionParser 是的接口并只有1个方法: getDescription(字符串threadName,可抛出T)

They say that ExceptionParser is an interface and has only 1 method: getDescription(String threadName, Throwable t).

因此​​,要异常的最相关的描述您可以创建一个实现类新的界面和覆盖 getDescription()

So, to get the most relevant description of the exception you may create a new class that implements that interface and overrides getDescription().

事情是这样的:

public class MyParser implements ExceptionParser{
   @Override
   public String getDescription(String threadName, Throwable t){
      return threadName+", "+t.get..... 
   }
}

(请注意,我不知道该的返回类型getDescription()字符串。你应该把适当的返回类型)

(Note that I'm not sure that return type of getDescription() is String. You should put the appropriate return type)

这篇关于谷歌Analytics(分析)的Andr​​oid SDK /异常报告:" myParser重新presents您ExceptionParser&QUOT的执行情况;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆