Note that there are some explanatory texts on larger screens.

plurals
  1. POdownloadlistener not working
    primarykey
    data
    text
    <p>How is the DownloadListener supposed to work? Probably I miss something. I did the following:</p> <ul> <li>Register a DownloadListener at a WebView.</li> <li>Open a WebView with a HTML page, containing a link (works).</li> <li>If I click on the link, the DownloadListener is not called.</li> </ul> <p>Here is a short portion of the code.</p> <pre><code>package rene.android.learnit; import android.app.*; import android.os.Bundle; import android.webkit.*; public class ShowWeb extends Activity implements DownloadListener { public static Lesson L; WebView WV; @Override public void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.showweb); WV=(WebView)findViewById(R.id.showweb); WV.setDownloadListener(this); WV.loadUrl("http://android.rene-grothmann.de/courses.html"); } public void onDownloadStart (String url, String agent, String disposition, String mimetype, long size) { Main.log(url+" "+mimetype+" "+size); } } </code></pre> <p>The logging works (I am using this everywhere to check my program), but nothing is logged, so the callback is not called. What happens is: The view tries to download the file, and fails, since zip files are not supported on my Android.</p> <p>The link goes to a zip-file. It is a usual </p> <pre><code>&lt;a href=...&gt;...&lt;/a&gt; </code></pre> <p>link.</p> <p>I tried to figure out the alternative method of registering an intent for zip files. But the documentation is so sparse, I could not do that. If I have to, is there an example?</p> <p>Any ideas?</p> <p>Thanks, R.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload