Search in sources :

Example 1 with LOAD_COLLECTION_COMPLETE

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

the class StudyOptionsFragment method onResume.

@Override
public void onResume() {
    super.onResume();
    Timber.d("onResume()");
    if (getAnkiActivity() == null) {
        return;
    }
    if (mTabLayout != null) {
        mTabLayout.selectTab(mTabLayout.getTabAt(0));
    }
    if (mCacheID != -1) {
        getCol().getDecks().select(mCacheID);
    } else {
        mCacheID = getCol().getDecks().selected();
    }
    new Handler().postDelayed(() -> {
        firstLoadDeck = false;
        refreshInterface(true);
    }, firstLoadDeck ? 0 : 500);
    // updateDeckList();
    /**
     * Complete task and enqueue fetching nonessential data for
     * startup.
     */
    CollectionTask.launchCollectionTask(LOAD_COLLECTION_COMPLETE);
    getAnkiActivity().supportInvalidateOptionsMenu();
}
Also used : Handler(android.os.Handler) NextCardHandler(com.ichi2.anki.AbstractFlashcardViewer.NextCardHandler)

Aggregations

Handler (android.os.Handler)1 NextCardHandler (com.ichi2.anki.AbstractFlashcardViewer.NextCardHandler)1