Im making a simple app for some friends to use on there android phone that shows my website with images. Im using a webview to show the website inside the app. I want the users, to be able to save the actual image. Either by Hold down on the image or actually clicking a button. Been looking around on googles docs ands cant seem to find anything for this.
Share
I haven’t actually played around with this yet, but from the docs it appears you have at least two (non-deprecated) options:
getHitTestResult()requestImageRef(Message msg)According to the documentation you can use the first option to test for
IMAGE_TYPEas result, and a url to the image is provided as well:The second option will give you a similar result:
Not sure if these options are compatible with a ‘long click’ too though.
Alternatively, how did you have in mind to link clicking a button to a specific image? Depending on your solution for this, you may also be able to simply capture all loaded image resources using
onLoadResource(WebView view, String url), build a list of image references and download the one that button click refers too.