Search in sources :

Example 1 with IMPORT_REPLACE

use of com.ichi2.async.CollectionTask.TASK_TYPE.IMPORT_REPLACE in project AnkiChinaAndroid by ankichinateam.

the class AnkiActivity method importReplace.

@Override
public void importReplace(String importPath) {
    try {
        AnkiDroidApp.getSharedPrefs(this).edit().remove(Consts.KEY_SYNC_CHINA_SESSION).apply();
        CollectionTask.launchCollectionTask(IMPORT_REPLACE, importReplaceListener(), new TaskData(importPath));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : JSONException(com.ichi2.utils.JSONException) IOException(java.io.IOException) ActivityNotFoundException(android.content.ActivityNotFoundException) DeckRenameException(com.ichi2.anki.exception.DeckRenameException) TaskData(com.ichi2.async.TaskData)

Aggregations

ActivityNotFoundException (android.content.ActivityNotFoundException)1 DeckRenameException (com.ichi2.anki.exception.DeckRenameException)1 TaskData (com.ichi2.async.TaskData)1 JSONException (com.ichi2.utils.JSONException)1 IOException (java.io.IOException)1