@Override public RequestHandler.Result load(Request data, int arg1) throws IOException { long imageId = Long.parseLong(data.uri.getLastPathSegment()); Bitmap bm = Stores.getInstance() .localPhotos() .getImageThumbnail(imageId); return new RequestHandler.Result(bm, Picasso.LoadedFrom.DISK); }
@Override public Result load(Request request, int networkPolicy) throws IOException { final long videoId = Long.parseLong(request.uri.getHost()); if (videoId<0) { return null; } Bitmap thumbnail = VideoStore.Video.Thumbnails.getThumbnail(mContext.getContentResolver(), videoId, VideoStore.Video.Thumbnails.MINI_KIND, null, !"1".equals(request.uri.getQueryParameter("nothumbcreation"))); if (thumbnail==null) { return null; } return new RequestHandler.Result(thumbnail, Picasso.LoadedFrom.DISK); }