private void initAdapter() {
        final ListView listView = getListView();
        registerForContextMenu(listView);

        adapter = new CacheListAdapter(this, adapter == null ? new ArrayList<>() : adapter.getList(), type, sortContext);
        adapter.setStoredLists(StoredList.UserInterface.getMenuLists(true, PseudoList.NEW_LIST.id));
        applyAdapterFilter();

        if (listFooter == null) {
            listFooter = getLayoutInflater().inflate(R.layout.cacheslist_footer, listView, false);
            listFooterLine1 = listFooter.findViewById(R.id.more_caches_1);
            listFooterLine2 = listFooter.findViewById(R.id.more_caches_2);
            listView.addFooterView(listFooter);
        }
        setListAdapter(adapter);

        adapter.forceSort();
        updateSortBar();

        listView.setOnScrollListener(new FastScrollListener(listView));
    }
Extract a cache from adapter data.

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