public class

WebResourceResponse

extends Object
java.lang.Object
   ↳ android.webkit.WebResourceResponse

Class Overview

A WebResourceResponse is return by shouldInterceptRequest(WebView, String) and contains the response information for a particular resource.

Summary

Public Constructors
WebResourceResponse(String mimeType, String encoding, InputStream data)
Construct a response with the given mime type, encoding, and data.
Public Methods
InputStream getData()
String getEncoding()
String getMimeType()
void setData(InputStream data)
Set the input stream containing the data for this resource.
void setEncoding(String encoding)
Set the encoding of the response data (i.e.
void setMimeType(String mimeType)
Set the mime type of the response data (i.e.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WebResourceResponse (String mimeType, String encoding, InputStream data)

Since: API Level 11

Construct a response with the given mime type, encoding, and data.

Parameters
mimeType The mime type of the data (i.e. text/html).
encoding The encoding of the bytes read from data.
data An InputStream for reading custom data. The implementation must implement read(byte[]).

Public Methods

public InputStream getData ()

Since: API Level 11

public String getEncoding ()

Since: API Level 11

public String getMimeType ()

Since: API Level 11

public void setData (InputStream data)

Since: API Level 11

Set the input stream containing the data for this resource.

Parameters
data An InputStream for reading custom data. The implementation must implement read(byte[]).

public void setEncoding (String encoding)

Since: API Level 11

Set the encoding of the response data (i.e. utf-8). This will be used to decode the raw bytes from the input stream.

public void setMimeType (String mimeType)

Since: API Level 11

Set the mime type of the response data (i.e. text/html).