Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在我的webview应用程序中,单个操作的多次下载不起作用_Java_Android_Webview_Download - Fatal编程技术网

Java 在我的webview应用程序中,单个操作的多次下载不起作用

Java 在我的webview应用程序中,单个操作的多次下载不起作用,java,android,webview,download,Java,Android,Webview,Download,我试图在一次操作中下载多个文件,但它不起作用 我的代码: var links =[ "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.exe", "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.dmg", "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraf

我试图在一次操作中下载多个文件,但它不起作用

我的代码:

var links =[
  "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.exe",
  "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.dmg",
  "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar"];

function downloadAll(urls) {  
  var link = document.createElement("a");  
  link.setAttribute("download", null); 
  link.style.display = "none";  
  document.body.appendChild(link);

  for (var i = 0; i<urls.length; i++) {
    link.setAttribute("href", urls[i]);
    link.click();
  }

  document.body.removeChild(link);
}
var链接=[
"https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.exe",
"https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.dmg",
"https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar"];
函数下载所有(URL){
var link=document.createElement(“a”);
link.setAttribute(“下载”,空);
link.style.display=“无”;
document.body.appendChild(链接);

对于(var i=0;i当你说“不工作”时,你的意思是什么?发生了什么,还是没有?当我点击按钮时,什么都没有发生它在Android chrome中工作,但在Android Webview应用程序中不工作当你说“不工作”时,你是什么意思?发生了什么,或者没有发生什么?当我点击按钮时,它在Android chrome中工作,但在Android Webview应用程序中不工作,什么都没有发生