问题描述
我开发Android应用,但在某些情况下,我的应用程序强制关闭
I develop android app but in some cases my app force close
我怎么能发送电子邮件到开发包含细节,如果强制关闭
在任何时候发生?
How can I send email to developer contains details if force close
happen in any time ?
推荐答案
借助库将满足您的要求。你只需要设置邮件。本教程和设置定义
The ACRA library will fulfill your requirement. You just need to setup the email. The tutorial and setup is defined here.
以.jar下载库LIB
Download the library with .jar in lib
您只需要定义应用程序类,并用以下code略高于应用类和重写的onCreate()
方法类似这样
You just need to define the Application class and write the following code just above application class and override onCreate()
method like this
@ReportsCrashes(formKey = "", // will not be used
mailTo = "reports@yourdomain.com",
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text)
public class MyApplication extends Application {
@Override
public void onCreate() {
ACRA.init(this);
super.onCreate();
}
}
这就是它。电子邮件的行动将得到开通的体内含有崩溃报告。
Thats it. The email action will get opened whose body contains crash report.
这篇关于如何发送错误报告给开发者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!