Skip to content

Instantly share code, notes, and snippets.

@sakurabird
Created October 10, 2013 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakurabird/6923843 to your computer and use it in GitHub Desktop.
Save sakurabird/6923843 to your computer and use it in GitHub Desktop.
Android WebViewでファイルのダウンロード
mWebView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype, long contentLength) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType(mimetype);
intent.setData(Uri.parse(url));
startActivity(intent);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment