Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- Android
- WebView
- Keyboard
- 키보드 화면가림
- android hashkey
- viewpager 갱신
- 안드로이드
- Soft keyboard
- mac 용량
- notifyDataSetChanged
- android webview download
- 맥 용량
- webview download
- reclyclerview
- android soft keyboard
- SDK
- android recyclerview
- Android sdk
Archives
- Today
- Total
눈누난나
android webview download 본문
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | webview.setDownloadListener( new DownloadListener() { @Override public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); request.setMimeType(mimetype); request.addRequestHeader( "User-Agent" , userAgent); request.setDescription( "Downloading file" ); String[] fileArray = url.split( "/" ); String fileName = fileArray[fileArray.length - 1 ]; request.setTitle(fileName); request.allowScanningByMediaScanner(); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName); DownloadManager dm = (DownloadManager) getActivity().getSystemService(DOWNLOAD_SERVICE); dm.enqueue(request); Toast.makeText(getActivity().getApplicationContext(), "Downloading File" , Toast.LENGTH_LONG).show(); } }); |
'android' 카테고리의 다른 글
ViewPager 내부에 있는 Fragment Data갱신하기 (1) | 2017.03.30 |
---|---|
android soft keyboard setting (0) | 2017.03.08 |
RecyclerView 기초 (0) | 2017.02.10 |
android sdk version (0) | 2017.02.09 |
Java source Hash key 얻기 (0) | 2017.02.09 |