Skip to content

Instantly share code, notes, and snippets.

View haakov's full-sized avatar

Håkon Vågsether haakov

View GitHub Profile
@jbrechtel
jbrechtel / AsyncTask.java
Created October 27, 2011 22:00
AsyncTask
public void onClick(View v) {
new DownloadImageTask().execute("http://example.com/image.png");
}
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
protected Bitmap doInBackground(String... urls) {
return loadImageFromNetwork(urls[0]);
}
protected void onPostExecute(Bitmap result) {