本文整理匯總了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();
}