我正在同步加载图片,以便在图片加载完成后显示通知。
bitmap = picasso.load(imageUrl).get();
它之前运行良好,但今天出现了异常:
Fatal Exception: java.lang.IllegalStateException: Unrecognized type of request: Request{
http://www.fulbori.com/mp/resources/image/19/17/e.jpg}
at com.squareup.picasso.BitmapHunter$2.load(BitmapHunter.java:66)
at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:206)
at com.squareup.picasso.RequestCreator.get(RequestCreator.java:396)
at com.jumbotail.app.utils.JtImageLoader.loadImageSync(JtImageLoader.java:397)
at com.jumbotail.app.notifs.JumboGcmIntentService.readInboundIntent(JumboGcmIntentService.java:213)
at com.jumbotail.app.notifs.JumboGcmIntentService.buildNotification(JumboGcmIntentService.java:273)
at com.jumbotail.app.notifs.JumboGcmIntentService.onHandleIntent(JumboGcmIntentService.java:49)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:174)
at android.os.HandlerThread.run(HandlerThread.java:60)
我知道当没有请求处理程序可以处理请求时,Picasso会抛出此错误。
根据请求的Uri
方案(即http
),canHandleRequest(Request data)
方法应该返回NetworkRequestHandler
中的true
。
但是所有的请求处理程序都返回了false
,包括NetworkRequestHandler
。因此,Picasso返回了ERRORING_HANDLER
,导致异常:IllegalStateException("Unrecognized type of request: " + request)
。
这个异常还有其他解释吗?
编辑:我还在 Picasso 中提出了 一个问题。