Skip to content

Instantly share code, notes, and snippets.

@chancila
Created November 18, 2012 19:22
Show Gist options
  • Save chancila/4106997 to your computer and use it in GitHub Desktop.
Save chancila/4106997 to your computer and use it in GitHub Desktop.
public interface ICallback<T> {
public onComplete(Bitmap b);
public onError();
}
interface IRemoteBitmapService {
public void <T> getBitmap(String url, ICallback<T> cbk);
}
...in Activity, assume mhandler and mImageView are members
mService.getBitmap("lemonparty.org/ifailatlife.png",new ICallback() {
public onComplete(Bitmap bmp, Handler h) {
mHandler.postRunnable(new Runnable() {
mImageView.setBitmapDrawable(bmp);
}
public onError() {
dosomething
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment