Upload files to geckoview

62 views Asked by At

I need a sample code to download files inside geckoview java language, I've been struggling for 4 days and can't do it.

private class MyContentDelegate implements PromptDelegate {

    @Nullable
    @Override
    public GeckoResult<PromptResponse> onFilePrompt(@NonNull GeckoSession geckoSession, @NonNull FilePrompt filePrompt) {
        Intent i = new Intent(Intent.ACTION_GET_CONTENT);
        i.addCategory(Intent.CATEGORY_OPENABLE);
        i.setType("image/*");

        GeckoResult<PromptResponse> res = new GeckoResult<>();
        mFileResponse = res;

        mFilePrompt = filePrompt;

        startActivityForResult(i, FILECHOOSER_RESULTCODE);

        return res;
    }
}
0

There are 0 answers