Android examples for android.widget:Adapter
get Cache Adapter
import android.widget.Adapter; import android.widget.BaseAdapter; import android.widget.HeaderViewListAdapter; public class Main{ public static CacheAdapter<?> getCacheAdapter(Adapter adapter) { if (adapter == null) { return null; }// w w w .jav a 2s . c o m CacheAdapter<?> cacheAdapter = null; if (adapter instanceof CacheAdapter<?>) { cacheAdapter = (CacheAdapter<?>) adapter; } else if (adapter instanceof HeaderViewListAdapter) { HeaderViewListAdapter headerViewAdapter = (HeaderViewListAdapter) adapter; if (headerViewAdapter.getWrappedAdapter() instanceof CacheAdapter<?>) { cacheAdapter = (CacheAdapter<?>) headerViewAdapter .getWrappedAdapter(); } } return cacheAdapter; } }