android.webkit
Class FileLoader
java.lang.Object
android.os.Handler
android.webkit.StreamLoader
android.webkit.FileLoader
class FileLoader
- extends StreamLoader
This class is a concrete implementation of StreamLoader that uses a
file or asset as the source for the stream.
|
Constructor Summary |
FileLoader(String url,
LoadListener loadListener,
Context context,
boolean asset)
Construct a FileLoader with the file URL specified as the content
source. |
|
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,
Context context,
boolean asset)
Construct a FileLoader 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 |
FileLoader
FileLoader(String url,
LoadListener loadListener,
Context context,
boolean asset)
- Construct a FileLoader with the file URL specified as the content
source.
- Parameters:
url - Full file url pointing to content to be loadedloadListener - LoadListener to pass the content tocontext - Context to use to access the asset.asset - true if url points to an asset.
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,
Context context,
boolean asset)
- Construct a FileLoader and instruct it to start loading.
- Parameters:
url - Full file url pointing to content to be loadedloadListener - LoadListener to pass the content tocontext - Context to use to access the asset.asset - true if url points to an asset.
Please submit a feedback, bug or feature