2014-09-20 91 views
4

圖像只顯示使用股票android模擬器,但不是在geny運動或實際Android設備運行4+和畢加索2.3.4。圖像未加載使用畢加索沒有錯誤給出

這是我使用的代碼:

Picasso picasso = new Picasso.Builder(EventViewActivity.this).listener(new Picasso.Listener() { 
    @Override 
    public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) { 
     exception.printStackTrace(); 
     Log.i("ERROR?", exception.getMessage()); 
    } 
}).build(); 

picasso.with(EventViewActivity.this).setLoggingEnabled(true); 
picasso.with(EventViewActivity.this).setIndicatorsEnabled(true); 

picasso.with(EventViewActivity.this).load(selEvent.photoThumbURLs.get(x)).into(iv, new Callback() { 
     @Override 
     public void onSuccess() {} 

     @Override 
     public void onError() { 
      Log.i("INFO","WHAT IS THE ERROR?!!"); 
     } 
    }); 
} 

這是我得到的是一個錯誤onImageLoadFailed從來沒有運行,我

09-20 10:05:01.836 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  created  [R2] Request{http://www.[[SITE]].com/BBT/uploads/322f6253-e018-40d9-9c02-ad8ac15a9e66/thumb_photo-0-vLTRb.jpg} 
09-20 10:05:01.836 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher enqueued  [R2]+4ms 
09-20 10:05:01.866 14329-14621/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+30ms 
09-20 10:05:02.016 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R1]+1791ms 
09-20 10:05:02.016 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher delivered [R1]+1793ms 
09-20 10:05:02.387 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+548ms 
09-20 10:05:02.387 14329-14622/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+554ms 
09-20 10:05:02.917 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+1077ms 
09-20 10:05:02.917 14329-14633/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+1078ms 
09-20 10:05:03.428 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher batched  [R2]+1590ms for error (will replay) 
09-20 10:05:03.628 14329-14329/com.cavedgeeks.barbadostennis I/INFO? WHAT IS THE ERROR?!! 
09-20 10:05:03.628 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R2]+1794ms 
09-20 10:05:03.638 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher delivered [R2]+1805ms 
09-20 10:11:48.703 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher replaying [R2]+406s 
09-20 10:11:48.713 14329-14637/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+406s 
09-20 10:11:48.753 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher enqueued  [R2]+406s 
09-20 10:11:48.763 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher replaying [R1]+408s 
09-20 10:11:48.763 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Hunter  joined  [R1]+408s to [R2]+406s, [R1]+408s 
09-20 10:11:49.264 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+407s, [R1]+409s 
09-20 10:11:49.274 14329-14621/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+407s, [R1]+409s 
09-20 10:11:49.794 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+407s, [R1]+409s 
09-20 10:11:49.794 14329-14622/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+407s, [R1]+409s 
09-20 10:11:50.305 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher batched  [R2]+408s, [R1]+410s for error (will replay) 
09-20 10:11:50.425 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher replaying [R2]+408s 
09-20 10:11:50.425 14329-14633/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+408s 
09-20 10:11:50.435 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher enqueued  [R2]+408s 
09-20 10:11:50.435 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher replaying [R1]+410s 
09-20 10:11:50.435 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Hunter  joined  [R1]+410s to [R2]+408s, [R1]+410s 
09-20 10:11:50.515 14329-14329/com.cavedgeeks.barbadostennis I/INFO? WHAT IS THE ERROR?!! 
09-20 10:11:50.515 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R2]+408s 
09-20 10:11:50.515 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R1]+410s 
09-20 10:11:50.515 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher delivered [R2]+408s, [R1]+410s 
09-20 10:11:50.945 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+409s, [R1]+410s 
09-20 10:11:50.945 14329-14637/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+409s, [R1]+410s 
09-20 10:11:51.456 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+409s, [R1]+411s 
09-20 10:11:51.456 14329-14621/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+409s, [R1]+411s 
09-20 10:11:51.956 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher batched  [R2]+410s, [R1]+411s for error (will replay) 
09-20 10:11:52.166 14329-14329/com.cavedgeeks.barbadostennis I/INFO? WHAT IS THE ERROR?!! 
09-20 10:11:52.166 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R2]+410s 
09-20 10:11:52.166 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher delivered [R2]+410s, [R1]+411s 
09-20 10:11:52.166 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R1]+411s 
09-20 10:12:54.577 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher replaying [R2]+472s 
09-20 10:12:54.577 14329-14622/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+472s 
09-20 10:12:54.597 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher enqueued  [R2]+472s 
09-20 10:12:54.607 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher replaying [R1]+474s 
09-20 10:12:54.637 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Hunter  joined  [R1]+474s to [R2]+472s, [R1]+474s 
09-20 10:12:55.158 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+473s, [R1]+474s 
09-20 10:12:55.158 14329-14633/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+473s, [R1]+474s 
09-20 10:12:55.718 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher retrying  [R2]+473s, [R1]+475s 
09-20 10:12:55.718 14329-14637/com.cavedgeeks.barbadostennis D/Picasso? Hunter  executing [R2]+473s, [R1]+475s 
09-20 10:12:56.229 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher batched  [R2]+474s, [R1]+476s for error (will replay) 
09-20 10:12:56.429 14329-14329/com.cavedgeeks.barbadostennis I/INFO? WHAT IS THE ERROR?!! 
09-20 10:12:56.429 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R2]+474s 
09-20 10:12:56.439 14329-14329/com.cavedgeeks.barbadostennis D/Picasso? Main  errored  [R1]+476s 
09-20 10:12:56.439 14329-14619/com.cavedgeeks.barbadostennis D/Picasso? Dispatcher delivered [R2]+474s, [R1]+476s 

編輯:好像這個問題直接關係到我的網站,imgur和其他網站工作正常。

回答

4

貌似我不得不卸載應用程序,然後在設備上再次運行它,它的工作因爲某些原因。

2

如果您只想使用畢加索。那麼它不可能是你的解決方案。

在畢加索,你沒有選擇尋找例外。 它只提供

@Override public void onSuccess() { 
} 
@Override public void onError() { 
} 

試試這個Glide library和它類似畢加索像一個行代碼

public boolean onException(Exception e, T model, Target<GlideDrawable> target, boolean isFirstResource) { 
     return false; 
    } 

    @Override 
    public boolean onResourceReady(GlideDrawable resource, T model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) { 
     return false; 
    } 
+0

謝謝我一定會檢查Glide庫作爲替代。 – Jebzaki 2014-09-20 18:08:29

+0

這是不正確的。自Picasso 1.1.0開始,你有'com.squareup.picasso.Picasso.Listener#onImageLoadFailed(Picasso,Uri,Exception)',你可以通過'Picasso.Builder#listener(Listener)'來使用它。 – Weekend 2016-12-29 08:41:08