Created
November 18, 2012 19:22
-
-
Save chancila/4106997 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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