Skip to content

Instantly share code, notes, and snippets.

@luizmarcus
Created February 23, 2016 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizmarcus/3d7312f48a2c9227b3ac to your computer and use it in GitHub Desktop.
Save luizmarcus/3d7312f48a2c9227b3ac to your computer and use it in GitHub Desktop.
/*
* Cria um thread em background para executar o método
* */
@Background
void executarDownload(){
Bitmap img = null;
try {
InputStream in = new java.net.URL(IMG_URL).openStream();
img = BitmapFactory.decodeStream(in);
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
atualizaViews(img);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment