我正在准备一个 webView 应用程序,所以我试图在其中启用文件下载,但解决方案导致问题,setDownloadListener 显示为红色,当我将鼠标悬停在它上面时,我看到消息无法解析符号 '
setDownloadListener
'
这是我在我的 android studio 中的示例代码
webView.setDownloadListener(new DownloadListener(){
public void onDownloadStart(String s, String s1, String s2,String s3, long l){
//Other codes
}
});
线
webView.setDownloadListener
给出错误无法解析符号'setDownloadListener'和DownloadListener()
给出错误“使'DownloadListener'返回'void'”
onDownloadStart
的参数或参数也给出错误消息“预期标识符,预期;”
我试过的解决方法是“无效并重启”,但问题依旧存在
请帮我解决这个问题