简体   繁体   中英

How to set image on a imageview in webview in android

Trying to change the profile image on the web view. But when trying the updated image showing a crashed image.

webView.loadUrl("javascript: (function() {document.getElementById('SelectedImage').src='"+profilePath+"';}) ();");

If profilePath is a Uri object, then you need to get the absolute path from the object.
Use File f = new File(profilePath.toString());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM