android.webkit
Class DataLoader
java.lang.Object
android.os.Handler
android.webkit.StreamLoader
android.webkit.DataLoader
class DataLoader
- extends StreamLoader
This class is a concrete implementation of StreamLoader that uses the
content supplied as a URL as the source for the stream. The mimetype
optionally provided in the URL is extracted and inserted into the HTTP
response headers.
|
Method Summary |
protected void |
buildHeaders(Headers headers)
This method is called when the headers are about to be sent to the
load framework. |
static void |
requestUrl(String url,
LoadListener loadListener)
Construct a DataLoader and instruct it to start loading. |
protected boolean |
setupStreamAndSendStatus()
This method is called when the derived class should setup mDataStream,
and call mHandler.status() to indicate that the load can occur. |
| Methods inherited from class android.os.Handler |
dispatchMessage, dump, getLooper, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toString |
DataLoader
DataLoader(String dataUrl,
LoadListener loadListener)
- Constructor uses the dataURL as the source for an InputStream
- Parameters:
dataUrl - data: URL string optionally containing a mimetypeloadListener - LoadListener to pass the content to
setupStreamAndSendStatus
protected boolean setupStreamAndSendStatus()
- Description copied from class:
StreamLoader
- This method is called when the derived class should setup mDataStream,
and call mHandler.status() to indicate that the load can occur. If it
fails to setup, it should still call status() with the error code.
- Specified by:
setupStreamAndSendStatus in class StreamLoader
- Returns:
- true if stream was successfully setup
buildHeaders
protected void buildHeaders(Headers headers)
- Description copied from class:
StreamLoader
- This method is called when the headers are about to be sent to the
load framework. The derived class has the opportunity to add addition
headers.
- Specified by:
buildHeaders in class StreamLoader
- Parameters:
headers - Map of HTTP headers that will be sent to the loader.
requestUrl
public static void requestUrl(String url,
LoadListener loadListener)
- Construct a DataLoader and instruct it to start loading.
- Parameters:
url - data: URL string optionally containing a mimetypeloadListener - LoadListener to pass the content to
Please submit a feedback, bug or feature