title: Implementing Picasso not loading image
body: <p>After I decided to implement <a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="nofollow">Universal Image Loader</a>, because I had implemented a method that convert <code>URL</code> to <code>Drawable</code>, but since I don't know how many images it will return my <code>SQLite</code> query I decided to implement an <code>Image Loader</code>...
  The thing is I'm stuck at the moment, cause I thought I did all what the <code>GitHub</code> say but at the time I load the <code>Image</code> it stays white and never loads.</p>
  
  <p>On my <code>Adapter class</code> I've changed the line of the <code>drawable</code> as : </p>
  
  <pre><code>Picasso.with(context)
              .load(Uri.parse(String.valueOf(item.icon)))
              .resize(180, 180)
              .placeholder(R.drawable.ic_launcher).into(viewHolder.ivIcon);
  </code></pre>
  
  <p>It works, beucase it shows yo me the ic_launcher icon... but never changes to the real image.</p>
  
  <p>On my class where I fetch the data I have this (on my OnCreate()) : </p>
  
  <pre><code>   new Thread(new Runnable() {
                  @Override
                  public void run() {
                      try {
                          Thread.sleep(2000);
  
  
                      } catch (InterruptedException e) {
                          e.printStackTrace();
                      }
  
                      new MyAsyncTask().execute();
  
                      getActivity().runOnUiThread(new Runnable() {
  
                          @Override
                          public void run() {
                      //   progress.dismiss();
                          }
                      });
                  }
  
              }).start();
          }
  </code></pre>
  
  <p>Then I created an inner class where I fetch the data into my <code>ListView</code>... but it doesn't works. I don't know If I've to delte those methods since I've changed it to <code>Picasso</code>.</p>
  
  <pre><code>private class MyAsyncTask extends AsyncTask&lt;Void, Void, Void&gt; {
      @Override
      protected void onPreExecute() {
      }
  
      @Override
      protected Void doInBackground(Void... params) {
  
          Conexion = new MarketSQLite(getActivity(), "market", null, 1);
          mItems = new ArrayList&lt;ListViewItem&gt;();
  
          db = Conexion.getReadableDatabase();
  
          Cursor c;
  
          c = db.rawQuery("Select NOM_OFER,PREU_OFERTA,DATA_F,FOTO,PERCENTDESCOMPTE from T_OFERTA", null);
          c.moveToFirst();
          if (c != null) {
              do {
                  for (int i = 0; i &lt; c.getColumnCount(); i++) {
                      Title = c.getString((c.getColumnIndex("NOM_OFER")));
                      Preu = c.getColumnIndex("PREU_OFERTA");
                      percent = c.getString((c.getColumnIndex("PERCENTDESCOMPTE")));
                      data_f = c.getString((c.getColumnIndex("DATA_F")));
                      URLTest = c.getString((c.getColumnIndex("FOTO")));
                      FOTO = Imagehandler(URLTest);
                      Log.e("", "" + c.getString(i));
  
                      // initialize and set the list adapter
  
  
                     // Toast.makeText(getActivity(), "Title" + Title + "Preu" + Preu + "Percent" + percent + "Cheese is " + data_f, Toast.LENGTH_LONG).show();
                  }
                  mItems.add(new ListViewItem(FOTO, Title, Preu.toString(), percent, data_f));
  
  
              }while (c.moveToNext());
          }
          c.close();
  
  return null;
      }
  
  
      @Override
      protected void onPostExecute(Void result) {
          super.onPostExecute(result);
          myAdapter = new ListViewDemoAdapter(getActivity(), mItems);
          setListAdapter(myAdapter);
      }
  }
  </code></pre>
  
  <p>Where <code>ImageHandler</code> is a method that I've created before this is : </p>
  
  <pre><code> protected Drawable Imagehandler(String url) {
          try {
              url=url.replaceAll(" ", "%20");
              InputStream is = (InputStream)this.fetch(url);
              Drawable d = Drawable.createFromStream(is, "src");
              return d;
          } catch (MalformedURLException e)
          {
              System.out.println(url);
              System.out.println("error at URI"+e);
              return null;
          }
          catch (IOException e)
          {
              System.out.println("io exception: "+e);
              System.out.println("Image NOT FOUND");
              return null;
          }
      }
  
      protected Object fetch(String address) throws MalformedURLException,IOException {
          URL url = new URL(address);
          Object content = url.getContent();
          return content;
      }
  </code></pre>
  
  <p>I don't know why isn't the image loading on my ListView if it shows all of the rest of data... </p>