FileContentProviderpublic class FileContentProvider extends android.content.ContentProvider WebView does not support file: loading. This class wraps a file load
with a content provider.
As HTMLViewer does not have internet access nor does it allow
Javascript to be run, it is safe to load file based HTML content. |
Fields Summary |
---|
public static final String | BASE_URI | public static final int | BASE_URI_LEN |
Methods Summary |
---|
public int | delete(android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)
throw new UnsupportedOperationException();
| public java.lang.String | getType(android.net.Uri uri)
// If the mimetype is not appended to the uri, then return an empty string
String mimetype = uri.getQuery();
return mimetype == null ? "" : mimetype;
| public android.net.Uri | insert(android.net.Uri uri, android.content.ContentValues values)
throw new UnsupportedOperationException();
| public boolean | onCreate()
return true;
| public android.os.ParcelFileDescriptor | openFile(android.net.Uri uri, java.lang.String mode)
if (!"r".equals(mode)) {
throw new FileNotFoundException("Bad mode for " + uri + ": " + mode);
}
String filename = uri.toString().substring(BASE_URI_LEN);
return ParcelFileDescriptor.open(new File(filename),
ParcelFileDescriptor.MODE_READ_ONLY);
| public android.database.Cursor | query(android.net.Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
throw new UnsupportedOperationException();
| public int | update(android.net.Uri uri, android.content.ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)
throw new UnsupportedOperationException();
|
|