[英]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. 如果
profilePath
是Uri对象,则需要从该对象获取绝对路径。
Use File f = new File(profilePath.toString());
使用
File f = new File(profilePath.toString());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.