在服务中使用 ACRA 的 Android 崩溃报告
我想在我的应用程序中使用 ACRA 进行崩溃报告。我之前在其他应用程序中使用过它。
我的应用程序没有任何活动,只是一项服务。我想要服务崩溃报告。
我如何使用 ACRA 来实现此目的?
它的 init 函数需要应用程序类的引用作为参数。我尝试在我的应用程序中使用应用程序类,但它不起作用。另外,如果我创建应用程序类,它会在手机上显示我的应用程序图标,这是我不想要的。
I want to use ACRA in my app for crash reporting. I have used it earlier in other app.
My app doesn't have nay activity and is just a service. I want to have crash reports for service.
How can I use ACRA for this?
Its init function expects a reference of application class as argument. I tried using application class in my app but it is not working. Also if I create application class, it shows my app' icon on phone, which I don't want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
即使您没有任何 Activity,也应该可以拥有应用程序类。当服务启动时,会预先创建 Application 类。
检查您是否在清单
中正确声明了您的应用程序。如果您没有使用 LAUNCHER 和 MAIN Intent 过滤器声明的 Activity,则启动器中的图标不应出现。
Having an application class should be possible even if you don't have any Activity. When a service is started the Application class is created beforehand.
Check that you declared correctly your application in the manifest
<application name=".MyApplication">
.The icon in the launcher should not appear if you don't have an Activity declared with LAUNCHER and MAIN intent filters.
实际上你可以使用 TestPoke 崩溃报告平台,集成只是一行代码,你可以利用它,发送日志和处理异常,这样你就可以更精细地控制你想在在线报告中看到的内容。
http://www.testpoke.com
Actually you can use TestPoke a crash report platform, the integration is just only one line of code, you can leverage of it, sending logs and handled exception, so you will have a more granular control of which you want to see in your online reports.
http://www.testpoke.com