Created
October 10, 2013 19:12
-
-
Save sakurabird/6923843 to your computer and use it in GitHub Desktop.
Android WebViewでファイルのダウンロード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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