Search in sources :

Example 1 with LocalMessageLoader

use of com.fsck.k9.ui.message.LocalMessageLoader in project k-9 by k9mail.

the class MessageLoaderHelper method startOrResumeLocalMessageLoader.

// load from database
private void startOrResumeLocalMessageLoader() {
    LocalMessageLoader loader = (LocalMessageLoader) loaderManager.<LocalMessage>getLoader(LOCAL_MESSAGE_LOADER_ID);
    boolean isLoaderStale = (loader == null) || !loader.isCreatedFor(messageReference);
    if (isLoaderStale) {
        Timber.d("Creating new local message loader");
        cancelAndClearCryptoOperation();
        cancelAndClearDecodeLoader();
        loaderManager.restartLoader(LOCAL_MESSAGE_LOADER_ID, null, localMessageLoaderCallback);
    } else {
        Timber.d("Reusing local message loader");
        loaderManager.initLoader(LOCAL_MESSAGE_LOADER_ID, null, localMessageLoaderCallback);
    }
}
Also used : LocalMessageLoader(com.fsck.k9.ui.message.LocalMessageLoader)

Aggregations

LocalMessageLoader (com.fsck.k9.ui.message.LocalMessageLoader)1