title: Is there a way to decode a .ICO file to a resolution bigger than 16x16?
body: <p>I'm working on android and trying to download and display a favicon(.ICO) from a website on an ImageView. </p>
  
  <p>So far I've manage to read the .ico from a website using an HTTP connection, retrieve it as an InputStream. Then I use a BitmapFactory to decode the stream into a Bitmap and display it on the ImageView. Here's the code:</p>
  
  <pre><code> public Bitmap getBitmapFromURL(URL src) {           
          try {
  
              URL url = new URL("http", "www.google.com", "/favicon.ico");
  
              HttpURLConnection connection = (HttpURLConnection) url.openConnection();                
  
              connection.setDoInput(true);       
  
              connection.connect();               
  
              InputStream input = connection.getInputStream();    
  
              BitmapFactory.Options options = new BitmapFactory.Options();
  
              Bitmap myBitmap = BitmapFactory.decodeStream(input, null, options);  
  
              return myBitmap;
  
          } catch (IOException e) {               
              e.printStackTrace();                
              return null;                
          }
      }
  </code></pre>
  
  <p>The problem is that the decoding of the inputStream always returns a small 16x16 Bitmap. If I well understood, a single .ICO file can store different image resolutions, like 32x32 and 64x64. My question is, is there a way to decode the 32x32 or the 64x64 Bitmap instead of the 16x16?</p>
  
  <p>Also, if there isn't a solution with BitmapFactory, is there a library or java code to do this?</p>
  
  <p><strong>NOTE:</strong> I don't want to resize the Bitmap, I want a 32x32(or bigger) resolution without losing the image quality by stretching.</p>
  
  <p>Thanks in advance.</p>