@NonNull
    @Override
    public Loader<SearchResult> onCreateLoader(final int type, final Bundle extras) {
        if (type != CACHE_LOADER_ID || extras == null) {
            throw new IllegalArgumentException("invalid loader type " + type + " or empty extras: " + extras);
        }
        final boolean isNextPage = extras.getBoolean(EXTRAS_NEXTPAGE, false);
        AbstractSearchLoader loader = null;
        preventAskForDeletion = true;

        if (isNextPage) {
            loader = new NextPageGeocacheListLoader(this, search);
        } else {
            switch (this.type) {
                case OFFLINE:
                    // open either the requested or the last list
                    if (extras.containsKey(Intents.EXTRA_LIST_ID)) {
                        listId = extras.getInt(Intents.EXTRA_LIST_ID);
                    } else {
                        listId = Settings.getLastDisplayedList();
                    }
                    if (listId == PseudoList.ALL_LIST.id) {
                        title = res.getString(R.string.list_all_lists);
                        markerId = EmojiUtils.NO_EMOJI;
                    } else if (listId <= StoredList.TEMPORARY_LIST.id) {
                        listId = StoredList.STANDARD_LIST_ID;
                        title = res.getString(R.string.stored_caches_button);
                        markerId = EmojiUtils.NO_EMOJI;
                    } else {
                        final StoredList list = DataStore.getList(listId);
                        // list.id may be different if listId was not valid
                        if (list.id != listId) {
                            showToast(getString(R.string.list_not_available));
                        }
                        listId = list.id;
                        title = list.title;
                        markerId = list.markerId;
                        preventAskForDeletion = list.preventAskForDeletion;
                    }

                    loader = new OfflineGeocacheListLoader(this, coords, listId, currentCacheFilter.get(), sortContext.getSort().getComparator(), false, offlineListLoadLimit);

                    break;
                case HISTORY:
                    title = res.getString(R.string.caches_history);
                    listId = PseudoList.HISTORY_LIST.id;
                    markerId = EmojiUtils.NO_EMOJI;
                    loader = new OfflineGeocacheListLoader(this, coords, PseudoList.HISTORY_LIST.id, currentCacheFilter.get(), VisitComparator.singleton, sortContext.getSort().isInverse(), offlineListLoadLimit);
                    break;
                case NEAREST:
                    title = res.getString(R.string.caches_nearby);
                    markerId = EmojiUtils.NO_EMOJI;
                    loader = new CoordsGeocacheListLoader(this, sortContext.getSort(), coords, true);
                    break;
                case COORDINATE:
                    title = coords.toString();
                    markerId = EmojiUtils.NO_EMOJI;
                    loader = new CoordsGeocacheListLoader(this, sortContext.getSort(), coords, false);
                    break;
                case KEYWORD:
                    final String keyword = extras.getString(Intents.EXTRA_KEYWORD);
                    markerId = EmojiUtils.NO_EMOJI;
                    title = listNameMemento.rememberTerm(keyword);
                    if (keyword != null) {
                        loader = new KeywordGeocacheListLoader(this, sortContext.getSort(), keyword);
                    }
                    break;
                case ADDRESS:
                    final String address = extras.getString(Intents.EXTRA_ADDRESS);
                    if (StringUtils.isNotBlank(address)) {
                        title = listNameMemento.rememberTerm(address);
                    } else {
                        title = coords.toString();
                    }
                    markerId = EmojiUtils.NO_EMOJI;
                    loader = new CoordsGeocacheListLoader(this, sortContext.getSort(), coords, false);
                    break;
                case FINDER:
                    final String username = extras.getString(Intents.EXTRA_USERNAME);
                    title = listNameMemento.rememberTerm(username);
                    markerId = EmojiUtils.NO_EMOJI;
                    if (username != null) {
                        loader = new FinderGeocacheListLoader(this, sortContext.getSort(), username);
                    }
                    break;
                case SEARCH_FILTER:
                    markerId = EmojiUtils.NO_EMOJI;
                    loader = new SearchFilterGeocacheListLoader(this, currentCacheFilter.get(), sortContext.getSort());
                    break;
                case OWNER:
                    final String ownerName = extras.getString(Intents.EXTRA_USERNAME);
                    title = listNameMemento.rememberTerm(ownerName);
                    markerId = EmojiUtils.NO_EMOJI;
                    if (ownerName != null) {
                        loader = new OwnerGeocacheListLoader(this, sortContext.getSort(), ownerName);
                    }
                    break;
                case MAP:
                    title = res.getString(R.string.map_map);
                    markerId = EmojiUtils.NO_EMOJI;
                    search = (SearchResult) extras.get(Intents.EXTRA_SEARCH);
                    replaceCacheListFromSearch();
                    //loadCachesHandler.sendMessage(Message.obtain());
                    loader = new NullGeocacheListLoader(this, search);
                    break;
                case LAST_VIEWED:
                    title = res.getString(R.string.cache_recently_viewed);
                    markerId = EmojiUtils.NO_EMOJI;
                    search = (SearchResult) extras.get(Intents.EXTRA_SEARCH);
                    replaceCacheListFromSearch();
                    //loadCachesHandler.sendMessage(Message.obtain());
                    loader = new NullGeocacheListLoader(this, search);
                    break;
                case POCKET:
                    final String shortGuid = extras.getString(Intents.EXTRA_POCKET_GUID);
                    final String pqHash = extras.getString(Intents.EXTRA_POCKET_HASH);
                    title = listNameMemento.rememberTerm(extras.getString(Intents.EXTRA_NAME));
                    markerId = EmojiUtils.NO_EMOJI;
                    loader = new PocketGeocacheListLoader(this, shortGuid, pqHash);
                    break;
                default:
                    //can never happen, makes Codacy happy
                    break;
            }
        }
        // if there is a title given in the activity start request, use this one instead of the default
        if (StringUtils.isNotBlank(extras.getString(Intents.EXTRA_TITLE))) {
            title = extras.getString(Intents.EXTRA_TITLE);
        }
        if (loader != null && extras.getSerializable(BUNDLE_ACTION_KEY) != null) {
            final AfterLoadAction action = (AfterLoadAction) extras.getSerializable(BUNDLE_ACTION_KEY);
            loader.setAfterLoadAction(action);
        }
        if (loader != null) {
            if (loader instanceof LiveFilterGeocacheListLoader) {
                currentAddFilterCriteria = ((LiveFilterGeocacheListLoader) loader).getAdditionalFilterParameter();
            } else {
                currentAddFilterCriteria = null;
            }
        }
        updateTitle();
        showProgress(true);
        refreshListFooter();

        if (loader == null) {
            Log.w("LOADER IS NULL!!!");
        }

        currentLoader = loader;
        return loader;
    }
start list activity, by searching around the given point.

@param name name of coordinates, will lead to a title like "Around ..." instead of directly showing the
            coordinates as title
main/src/main/java/cgeo/geocaching/CacheListActivity.java