picview/src/com/google/android/apps/picview/request/CachedImageFetcher.java
private Bitmap fetchImageFromWeb(URL url) {
    try {
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setDoInput(true);
      conn.connect();
      InputStream is = conn.getInputStream();
      return BitmapFactory.decodeStream(is);
    } catch (OutOfMemoryError ex) {
      Log.e(TAG, "Out of memory, cannot create bitmap.");
      System.gc();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
/**
   * Fetches the given image from the web.
   */
Fetches the given image from the web.
Fetches the given image from the web .
private Bitmap fetchImageFromWeb(URL url) {
    try {
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setDoInput(true);
      conn.connect();
      InputStream is = conn.getInputStream();
      return BitmapFactory.decodeStream(is);
    } catch (OutOfMemoryError ex) {
      Log.e(TAG, "Out of memory, cannot create bitmap.");
      System.gc();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
private Bitmap fetchImageFromWeb ( URL url ) { try { HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setDoInput ( true ) ; conn . connect ( ) ; InputStream is = conn . getInputStream ( ) ; return BitmapFactory . decodeStream ( is ) ; } catch ( OutOfMemoryError ex ) { Log . e ( TAG , "Out of memory, cannot create bitmap." ) ; System . gc ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; }
Fetches the given image from the web.
Fetches the given image from the web .