public abstract class RequestHandler
extends java.lang.Object
RequestHandler
allows you to extend Picasso to load images in ways that are not
supported by default in the library.
RequestHandler
must be subclassed to be used. You will have to override two methods
(canHandleRequest(Request)
and load(Request, int)
) with your custom logic to
load images.
You should then register your RequestHandler
using
Picasso.Builder.addRequestHandler(RequestHandler)
Note: This is a beta feature. The API is subject to change in a backwards incompatible way at any time.
Modifier and Type | Class and Description |
---|---|
static class |
RequestHandler.Result
|
Constructor and Description |
---|
RequestHandler() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canHandleRequest(Request data)
Whether or not this
RequestHandler can handle a request with the given Request . |
abstract RequestHandler.Result |
load(Request request,
int networkPolicy)
Loads an image for the given
Request . |
public abstract boolean canHandleRequest(Request data)
RequestHandler
can handle a request with the given Request
.public abstract RequestHandler.Result load(Request request, int networkPolicy) throws java.io.IOException
Request
.request
- the data from which the image should be resolved.networkPolicy
- the NetworkPolicy
for this request.java.io.IOException