public MessageItem getCachedMessageItem(String type, long msgId, Cursor c) { MessageItem item = mMessageItemCache.get(getKey(type, msgId)); if (item == null && c != null && isCursorValid(c)) { try { item = new MessageItem(mContext, type, c, mColumnsMap, mHighlight); mMessageItemCache.put(getKey(item.mType, item.mMsgId), item); } catch (MmsException e) { Log.e(TAG, "getCachedMessageItem: ", e); } } return item; }
@Override public void notifyDataSetChanged() { super.notifyDataSetChanged(); if (LOCAL_LOGV) { Log.v(TAG, "MessageListAdapter.notifyDataSetChanged()."); } mMessageItemCache.evictAll(); if (mOnDataSetChangedListener != null) { mOnDataSetChangedListener.onDataSetChanged(this); } }
public void cancelBackgroundLoading() { mMessageItemCache.evictAll(); // causes entryRemoved to be called for each MessageItem // in the cache which causes us to cancel loading of // background pdu's and images. }