Exemple #1
0
    @Override
    protected void onPostExecute(String result) {
      super.onPostExecute(result);

      progressDialog.dismiss();

      // download images
      ImageDownloader getImages = new ImageDownloader(activity);
      getImages.execute();
    }
  public void downloadImage(View view) {
    // http://www.howbigismypotato.com/images/potato.jpg

    ImageDownloader task = new ImageDownloader();
    Bitmap myImage;

    try {
      myImage = task.execute("http://www.howbigismypotato.com/images/potato.jpg").get();

      downloadedImage.setImageBitmap(myImage);

    } catch (Exception e) {
      e.printStackTrace();
    }
    Log.i("interact", "button tapped");
  }