Example #1
0
 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;
 }
Example #2
0
  @Override
  public void notifyDataSetChanged() {
    super.notifyDataSetChanged();
    if (LOCAL_LOGV) {
      Log.v(TAG, "MessageListAdapter.notifyDataSetChanged().");
    }

    mMessageItemCache.evictAll();

    if (mOnDataSetChangedListener != null) {
      mOnDataSetChangedListener.onDataSetChanged(this);
    }
  }
Example #3
0
 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.
 }