title: Using Picasso with Image Getter
body: <p>I ma building a chat application and I am attempting to append an image to an EditText, through use of Picasso to get the image from a URL and the append and ImageGetter to attach the image to the EditText. However, what I have implemented below does not work, as appending messages when using the app displays nothing (but the message does show up in the database). </p>
  
  <p>I have tested without using Picasso, as simply just using the ImageGetter with an image resource within the app works just fine, only it's not from a URL as is required. </p>
  
  <p>What is the proper way to configure the ImageGetter and/or the append method so that this functionality will work with Picasso? Or is there a simpler way?</p>
  
  <p>Append method: </p>
  
  <pre><code>public void appendToMessageHistory(final String username,
              final String message) {
          if (username != null &amp;&amp; message != null) {
  
              Picasso.with(getBaseContext())
                      .load("http://localhost:3000/uploads/campaign/image/2/2.jpg")
                      .into(new Target() {
  
                          @Override
                          public void onPrepareLoad(Drawable arg0) {
  
                          }
  
                          @Override
                          public void onBitmapLoaded(Bitmap bitmap,
                                  LoadedFrom arg1) {
                              Drawable drawImage = new BitmapDrawable(
                                      getBaseContext().getResources(), bitmap);
  
                              drawImage.setBounds(0, 0,
                                      drawImage.getIntrinsicHeight(),
                                      drawImage.getIntrinsicWidth());
                              messageHistoryText.append(Html.fromHtml("&lt;b&gt;"
                                      + username + ":" + "&lt;/b&gt;" + "&lt;br&gt;"));
                              messageHistoryText.append(Html.fromHtml(message
                                      + "&lt;hr&gt;" + "&lt;br&gt;")
                                      + System.getProperty("line.separator") + "");
  
                              messageHistoryText.append(Html
                                      .fromHtml("&lt;img src = '" + drawImage
                                              + "'/&gt;",
                              imageGetter,
                              null));
                          }
  
                          @Override
                          public void onBitmapFailed(Drawable arg0) {
  
                          }
                      });
  
          }
      }
  </code></pre>
  
  <p>ImageGetter:</p>
  
  <pre><code>ImageGetter imageGetter = new ImageGetter() {
          Drawable imageUsed=null;
  
          @Override
          public Drawable getDrawable(String source) {
  
              Picasso.with(getBaseContext())
                      .load("http://localhost:3000/uploads/campaign/image/2/2.jpg")
                      .into(new Target() {
  
                          @Override
                          public void onPrepareLoad(Drawable arg0) {
  
                          }
  
                          @Override
                          public void onBitmapLoaded(Bitmap bitmap,
                                  LoadedFrom arg1) {
                              Drawable drawImage = new BitmapDrawable(
                                      getBaseContext().getResources(), bitmap);
  
                              drawImage.setBounds(0, 0,
                                      drawImage.getIntrinsicHeight(),
                                      drawImage.getIntrinsicWidth());
  
                              imageUsed=drawImage;
  
                          }
  
                          @Override
                          public void onBitmapFailed(Drawable arg0) {
  
                          }
                      });
  
              return imageUsed;
          }
  
      };
  </code></pre>