@SuppressLint("SetTextI18n")
    private void refreshListFooter(final boolean cachesAreLoading) {
        if (listFooter == null) {
            return;
        }

        if (cachesAreLoading) {
            setView(listFooterLine1, res.getString(R.string.caches_more_caches_loading), null);
            setViewGone(listFooterLine2);
            return;
        }

        final int unfilteredListSize = search == null ? adapter.getOriginalListCount() : search.getCount();
        final int totalAchievableListSize = search == null ? unfilteredListSize : Math.max(0, search.getTotalCount());
        final boolean moreToShow = unfilteredListSize > 0 && totalAchievableListSize > unfilteredListSize;

        if (moreToShow && type.isOnline) {
            setViewGone(listFooterLine2);
            setView(listFooterLine1, res.getString(R.string.caches_more_caches) + " (" + res.getString(R.string.caches_more_caches_currently) + ": " + unfilteredListSize + ")", v -> {
                showProgress(true);
                restartCacheLoader(true, null);
            });
        } else if (type.isOnline) {
            setViewGone(listFooterLine2);
            setView(listFooterLine1, res.getString(adapter.isEmpty() ? R.string.caches_no_cache : R.string.caches_more_caches_no), null);
        } else if (moreToShow && type.isStoredInDatabase) {
            final int missingCaches = totalAchievableListSize - unfilteredListSize;
            if (missingCaches > getOfflineListLimitIncrease()) {
                final String info = res.getQuantityString(R.plurals.caches_more_caches_next_x, getOfflineListLimitIncrease(), getOfflineListLimitIncrease());
                setView(listFooterLine1, info, v -> {
                    if (offlineListLoadLimit >= 0) {
                        offlineListLoadLimit += getOfflineListLimitIncrease();
                        refreshCurrentList();
                    }
                });
            } else {
                setViewGone(listFooterLine1);
            }
            setView(listFooterLine2, res.getString(R.string.caches_more_caches_remaining, missingCaches, totalAchievableListSize), v -> {
                offlineListLoadLimit = 0;
                refreshCurrentList();
            });
        } else {
            setViewGone(listFooterLine1);
            setViewGone(listFooterLine2);
        }
    }
Extract a cache from adapter data.

@param adapterInfo an adapterInfo
@return the pointed cache
main/src/main/java/cgeo/geocaching/CacheListActivity.java