override fun onShowFileChooser(
webView: WebView,
filePathCallback: ValueCallback<Array<Uri>>,
fileChooserParams: FileChooserParams
): Boolean {
mFilePathCallback = filePathCallback
val intent =
if
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Log.d(
"test"
,
"version lollipop!"
);
fileChooserParams.createIntent()
}
else
{
TODO(
"VERSION.SDK_INT < LOLLIPOP"
)
Intent(Intent.ACTION_GET_CONTENT);
}
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(
"image/*"
);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,
true
);
startActivityForResult(Intent.createChooser(intent,
"Image Browser"
), FILECHOOSER_RESULTCODE)
return
true
}