Skip to content

Instantly share code, notes, and snippets.

@takuo

takuo/gist:1294790

Created Oct 18, 2011
Embed
What would you like to do?
Android code snippet - using Thread
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
final Bitmap bitmap = loadImageFromNetwork("http://example.com/image.png");
mImageView.post(new Runnable() {
public void run() {
mImageView.setImageBitmap(bitmap);
}
});
}
}).start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment