Why ‘onShowFileChooser’ overrides nothing?

Tell me what I did wrong in my code, why ‘onShowFileChooser’ overrides nothing? The class was created to allow webview to upload files from the phone “webview import file”.

class FileChooseClient(private val activity: ActivityChoser) : WebChromeClient() {
override fun onShowFileChooser(v: WebView?, fpc: ValueCallback<Uri>?, fcp: FileChooserParams): Boolean {
    if (activity.uploadMessage != null) {
        activity.uploadMessage = null

    activity.uploadMessage = fpc

    val intent: Intent = fcp.createIntent()
    try {
        activity.startActivityForResult(intent, ActivityChoser.REQUEST_SELECT_FILE)
        (activity as Activity).overridePendingTransition(
    } catch (e: ActivityNotFoundException) {
        activity.uploadMessage = null
        return false

    return true

interface ActivityChoser {
    companion object {
        const val REQUEST_SELECT_FILE = 100;
    var uploadMessage: ValueCallback<Uri>?
    fun startActivityForResult(intent: Intent, req: Int)



Because the second parameter’s type is wrong; it should be


or maybe


because a file chooser can choose multiple files (? after Array should definitely be there if I understand the documentation correctly).