Search in sources :

Example 1 with TaskListener

use of com.ichi2.async.DeckTask.TaskListener in project Anki-Android by Ramblurr.

the class MultimediaCardEditorActivity method save.

private void save() {
    NoteService.saveMedia((MultimediaEditableNote) mNote);
    NoteService.updateJsonNoteFromMultimediaNote(mNote, mEditorNote);
    TaskListener listener = new TaskListener() {

        @Override
        public void onProgressUpdate(TaskData... values) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onPreExecute() {
        // TODO Auto-generated method stub
        }

        @Override
        public void onPostExecute(TaskData result) {
        // TODO Auto-generated method stub
        }
    };
    if (mAddNote) {
        DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ADD_FACT, listener, new DeckTask.TaskData(mEditorNote));
    } else {
        DeckTask.launchDeckTask(DeckTask.TASK_TYPE_UPDATE_FACT, listener, new DeckTask.TaskData(mCol.getSched(), mCard, false));
    }
    setResult(Activity.RESULT_OK);
    finish();
    animateRight();
}
Also used : TaskListener(com.ichi2.async.DeckTask.TaskListener) TaskData(com.ichi2.async.DeckTask.TaskData) DeckTask(com.ichi2.async.DeckTask) TaskData(com.ichi2.async.DeckTask.TaskData)

Aggregations

DeckTask (com.ichi2.async.DeckTask)1 TaskData (com.ichi2.async.DeckTask.TaskData)1 TaskListener (com.ichi2.async.DeckTask.TaskListener)1