Download with tag a in webview [closed]

1

Hello

I have a working webview, I'm trying to create the following html tag:

 for(int i = 0; i < nm.size(); i++) {
     html.append("<a https://example.com.br/ret/AttachedFile.do?command=showFile&generatedId=").append(id.get(i)).append(">").append(nm.get(i)).append("</a><br />");
 }

That would look like this:

<a https://example.com.br/ret/AttachedFile.do?command=showFile&generatedId=64>Download archive</a><br />

However, when I click on the item to download the content, nothing happens ... What do I have to do, in order for the click to download the file with the url informed? Thanks!

    
asked by anonymous 06.11.2015 / 13:37

1 answer

0

As commented by Alisson, you need to put the href attribute in the tag:

html.append("<a href=\"https://example.com.br/ret/AttachedFile.do?command=showFile&generatedId=").append(id.get(i)).append("\">").append(nm.get(i)).</a><br />")

Note the backslashes in places where you have literal quotes ( \" )

    
21.09.2016 / 14:45