use of com.ichi2.compat.CompatV5 in project Anki-Android by Ramblurr.
the class AnkiDroidApp method onCreate.
/**
* On application creation.
*/
@Override
public void onCreate() {
super.onCreate();
if (isNookHdPlus() && AnkiDroidApp.SDK_VERSION == 15) {
mCompat = new CompatV15NookHdPlus();
} else if (isNook()) {
mCompat = new CompatV4();
} else if (AnkiDroidApp.SDK_VERSION >= 16) {
mCompat = new CompatV16();
} else if (AnkiDroidApp.SDK_VERSION >= 15) {
mCompat = new CompatV15();
} else if (AnkiDroidApp.SDK_VERSION >= 11) {
mCompat = new CompatV11();
} else if (AnkiDroidApp.SDK_VERSION >= 9) {
mCompat = new CompatV9();
} else if (AnkiDroidApp.SDK_VERSION >= 5) {
mCompat = new CompatV5();
} else {
mCompat = new CompatV4();
}
sInstance = this;
Connection.setContext(getApplicationContext());
// Error Reporter
CustomExceptionHandler customExceptionHandler = CustomExceptionHandler.getInstance();
customExceptionHandler.init(sInstance.getApplicationContext());
Thread.setDefaultUncaughtExceptionHandler(customExceptionHandler);
SharedPreferences preferences = getSharedPrefs(this);
sInstance.mHooks = new Hooks(preferences);
setLanguage(preferences.getString("language", ""));
// Assign some default settings if necessary
if (!preferences.contains("deckPath")) {
Editor editor = preferences.edit();
// Create the folder "AnkiDroid", if not exists, where the decks
// will be stored by default
String deckPath = getDefaultAnkiDroidDirectory();
createDirectoryIfMissing(new File(deckPath));
// Put the base path in preferences pointing to the default "AnkiDroid" folder
editor.putString("deckPath", deckPath);
// Using commit instead of apply even though we don't need a return value.
// Reason: apply() not available on Android 1.5
editor.commit();
}
}
Aggregations