Interface CefriumDialogHandler
public interface CefriumDialogHandler
Handles the file-chooser dialog for
<input type=file> (WebView
WebChromeClient.onShowFileChooser), mirroring CEF's
CefDialogHandler. Register with
CefriumBrowser.setDialogHandler(CefriumDialogHandler). Without a
handler set, file inputs cannot pick a file.
Delivered on the Android main thread so you can launch an Intent directly.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSupplies the selected file path(s)/URI(s), or cancels. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFile dialog mode: open a single file.static final intFile dialog mode: open a folder.static final intFile dialog mode: open multiple files.static final intFile dialog mode: save a file. -
Method Summary
Modifier and TypeMethodDescriptionvoidonFileDialog(int mode, String title, String[] acceptFilters, CefriumDialogHandler.FileDialogCallback callback) A file input asked to choose file(s).
-
Field Details
-
MODE_OPEN
static final int MODE_OPENFile dialog mode: open a single file.- See Also:
-
MODE_OPEN_MULTIPLE
static final int MODE_OPEN_MULTIPLEFile dialog mode: open multiple files.- See Also:
-
MODE_OPEN_FOLDER
static final int MODE_OPEN_FOLDERFile dialog mode: open a folder.- See Also:
-
MODE_SAVE
static final int MODE_SAVEFile dialog mode: save a file.- See Also:
-
-
Method Details
-
onFileDialog
void onFileDialog(int mode, String title, String[] acceptFilters, CefriumDialogHandler.FileDialogCallback callback) A file input asked to choose file(s). Launch a picker (e.g.ACTION_GET_CONTENT) and deliver the result throughcallback. The mode's low bits are the CEF file-dialog mode; useMODE_OPENetc. (mask with 0xF).- Parameters:
mode- CEF file-dialog mode/flags.title- Suggested dialog title (may be empty).acceptFilters- MIME types / extensions the input accepts.callback- Result callback.
-