0

I have problem in loading image resource file in Android webview. Image name has space in words e.g,

file:///android_asset/images/abc xyz.jpg

So problem is webview consider %20 in name when ever space comes so it can not compare with image which is inside asset folder.

I am not sure is there any problem with asset manager which is giving name like just abc I mean before space name or its problem in webview?.

Andy
  • 123
  • 1
  • 1
  • 12

1 Answers1

0
file:///android_asset/images/abc.html

create abc.html save this abc.html to your assets folder

...
<body>
<img src="file:///android_asset/images/abc xyz.jpg"/>
</body>
....

String url = "file:///android_asset/images/abc.html"
MAC
  • 15,799
  • 8
  • 54
  • 95
  • file name we can not change name should be as it is but we need to handle the space in name – Andy Jul 03 '12 at 09:47
  • read my answer carefully. you do not need to change image name. create one abc.html file and write above line in that file – MAC Jul 03 '12 at 10:10
  • I have tried what you suggest for put body tag but its not working – Andy Jul 03 '12 at 11:19