Skip to content

Commit

Permalink
add onGetNotInCache
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinea committed Jan 4, 2014
1 parent 1c73500 commit 8318588
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cn/trinea/android/demo/ImageSDCardCacheDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public void onPreGet(String imageUrl, View view) {
// Log.e(TAG_CACHE, "pre get image");
}

@Override
public void onGetNotInCache(String imageUrl, View view) {
// you can do something when image not in cache, for example set default image
}

/**
* callback function after get image failed, run on ui thread
*
Expand All @@ -116,9 +121,7 @@ public void onPreGet(String imageUrl, View view) {
@Override
public void onGetFailed(String imageUrl, String imagePath, View view, FailedReason failedReason) {
Log.e(TAG_CACHE,
new StringBuilder(128).append("get image ").append(imageUrl).append(" error, failed type is: ")
.append(failedReason.getFailedType()).append(", failed reason is: ")
.append(failedReason.getCause().getMessage()).toString());
new StringBuilder(128).append("get image ").append(imageUrl).append(" error, failed type is: ").append(failedReason.getFailedType()).append(", failed reason is: ").append(failedReason.getCause().getMessage()).toString());
}
};
IMAGE_SD_CACHE.setOnImageSDCallbackListener(imageCallBack);
Expand Down

0 comments on commit 8318588

Please sign in to comment.