title: Android HTML.ImageGetter Images resized
body: <p>I have a TextView which load a HTML content (which has img tags as well). My problem is that some images are too big so the app crashes. Is there any way to make the images to be all to the same size ?</p>
  
  <p>A sample of my code :</p>
  
  <pre><code>            String EntireStire = "&lt;b&gt;" + mItem.title + " &lt;/b&gt; &lt;br&gt; &lt;img src='"
                  + mItem.photo + "' &gt; " + " &lt;br&gt;&lt;small&gt;" + mItem.description
                  + " &lt;br&gt; " + mItem.content + "&lt;/small&gt;";
  
          noteView.setText(Html.fromHtml(EntireStire, new MyImageGetter(),
                  null));
          noteView.setMovementMethod(LinkMovementMethod.getInstance());
      }
  
      return rootView;
  }
  
  private class MyImageGetter implements Html.ImageGetter {
  
      @Override
      public Drawable getDrawable(String arg0) {
          Bitmap bitmap;
          try {
              bitmap = BitmapFactory.decodeStream(
                      (InputStream) new URL(arg0).getContent(), null, null);
              @SuppressWarnings("deprecation")
              Drawable drawable = new BitmapDrawable(bitmap);
              drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),
                      drawable.getIntrinsicHeight());
              return drawable;
          } catch (Exception e) {
              Drawable d = getResources().getDrawable(R.drawable.ic_launcher);
              d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
              return d;
          }
      }
  }
  </code></pre>