本文整理汇总了Java中org.acra.ReportingInteractionMode类的典型用法代码示例。如果您正苦于以下问题:Java ReportingInteractionMode类的具体用法?Java ReportingInteractionMode怎么用?Java ReportingInteractionMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReportingInteractionMode类属于org.acra包,在下文中一共展示了ReportingInteractionMode类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAcraReportingMode
import org.acra.ReportingInteractionMode; //导入依赖的package包/类
/**
* Set the reporting mode for ACRA based on the value of the reportErrorMode preference
* @param value value of reportErrorMode preference
*/
public void setAcraReportingMode(String value) {
SharedPreferences.Editor editor = ACRA.getACRASharedPreferences().edit();
// Set the ACRA disable value
if (value.equals(FEEDBACK_REPORT_NEVER)) {
editor.putBoolean("acra.disable", true);
} else {
editor.putBoolean("acra.disable", false);
// Switch between auto-report via toast and manual report via dialog
try {
if (value.equals(FEEDBACK_REPORT_ALWAYS)) {
ACRA.getConfig().setMode(ReportingInteractionMode.TOAST);
ACRA.getConfig().setResToastText(R.string.feedback_auto_toast_text);
} else if (value.equals(FEEDBACK_REPORT_ASK)) {
ACRA.getConfig().setMode(ReportingInteractionMode.DIALOG);
ACRA.getConfig().setResToastText(R.string.feedback_manual_toast_text);
}
} catch (ACRAConfigurationException e) {
Timber.e("Could not set ACRA report mode");
}
}
editor.commit();
}
示例2: onCreate
import org.acra.ReportingInteractionMode; //导入依赖的package包/类
/**
* We do not do any loading or starting when the application is loaded.
* This can be requested by using useService()
*/
@Override
public void onCreate() {
super.onCreate();
LoadStoreIconData.onCreate(this);
ACRAConfiguration config = ACRA.getNewDefaultConfig(this);
config.setFormUri(getString(R.string.acralyzer_http_url));
config.setFormUriBasicAuthLogin(getString(R.string.acralyzer_http_login));
config.setFormUriBasicAuthPassword(getString(R.string.acralyzer_http_pwd));
config.setReportType(HttpSender.Type.JSON);
config.setResToastText(R.string.crash_toast_text);
config.setBuildConfigClass(BuildConfig.class);
try {
config.setMode(ReportingInteractionMode.TOAST);
} catch (ACRAConfigurationException e) {
e.printStackTrace();
}
config.setCustomReportContent(new ReportField[]{ReportField.REPORT_ID, ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME, ReportField.PHONE_MODEL, ReportField.ANDROID_VERSION, ReportField.BUILD, ReportField.BRAND, ReportField.PRODUCT, ReportField.TOTAL_MEM_SIZE, ReportField.AVAILABLE_MEM_SIZE, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.USER_COMMENT, ReportField.USER_APP_START_DATE, ReportField.USER_CRASH_DATE, ReportField.USER_EMAIL, ReportField.IS_SILENT, ReportField.DEVICE_FEATURES, ReportField.SHARED_PREFERENCES, ReportField.THREAD_DETAILS});
ACRA.setConfig(config);
ACRA.init(this);
lifecycleHandler = new LifecycleHandler();
registerActivityLifecycleCallbacks(lifecycleHandler);
}
示例3: onCreate
import org.acra.ReportingInteractionMode; //导入依赖的package包/类
@Override
public void onCreate() {
/*
* The following line triggers the initialization of ACRA
* ACRA is used to help with debug logs etc.
*/
ACRA.init(this);
ACRA.getErrorReporter().setReportSender(new CrashReporterSave(this));
ACRAConfiguration conf = ACRA.getNewDefaultConfig(this);
try {
conf.setCustomReportContent(new ReportField[] { DISPLAY, USER_COMMENT, USER_EMAIL, TOTAL_MEM_SIZE, AVAILABLE_MEM_SIZE });
conf.setResDialogCommentPrompt(R.string.crash_dialog_comment_prompt);
conf.setResToastText(R.string.crash_toast_text);
conf.setResDialogText(R.string.crash_dialog_text);
conf.setResDialogEmailPrompt(R.string.crash_dialog_email_prompt);
conf.setResDialogTitle(R.string.crash_dialog_title);
conf.setResDialogOkToast(R.string.crash_dialog_ok_toast);
conf.setMode(ReportingInteractionMode.DIALOG);
} catch (ACRAConfigurationException e) {
e.printStackTrace();
}
ACRA.setConfig(conf);
// Have to call this to continue loading Android
super.onCreate();
}