I want to save the images displayed in webview into local storage, and webview should have cached the images it displays ,how can i access the cached images and save them into storage?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
try the above to capture image from webView
I did used the code from above and it "worked" but it was producing black images only so after a couple of hours here are my corrections, now it writes on the external sd card with no deprecation risks or path issues...
also here is the beginning of my MainActivity
Then you have to set a WebViewClient to your WebView and override shouldOverrideUrlLoading and onLoadResource methods. Let me give you a simple example:
Maybe you should check if the file exist in cache file.
get the hash key of url.
Chromium use the pre 8 bytes of hashcode. so maybe you should do
then you get the hash string. cache filename in chromium is hash + "_" + fileindex, usually the filename is zero. so the filename should be hash_0;
2 get the content from the cache file.