package de.htwdd;
import android.app.Application;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
@ReportsCrashes(
mode = ReportingInteractionMode.DIALOG,
mailTo = "app@htw-dresden.de",
resDialogText = R.string.crash_dialog_text,
resDialogTitle = R.string.crash_dialog_title, // optional. default is your application name
resDialogIcon = R.drawable.ic_warning_black_24dp, //optional. default is a warning sign
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, // optional. When defined, adds a user text field input with this text resource as a label
resDialogOkToast = R.string.crash_dialog_ok_toast, // optional. displays a Toast message when the user accepts to send a report.
sharedPreferencesName = "de.htwdd_preferences"
)
public class HTWDDApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Setze Einstellungen beim ersten Starten der App
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (sharedPreferences.getBoolean("FIRST_RUN", true)){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("FIRST_RUN", false);
editor.putBoolean("acra.enable", false);
editor.apply();
}
// Arca starten
ACRA.init(this);
}
}