Webview: Cannot Display Local Image On Phone But Displays On Emulator
I have went through all the posts on displaying local images on android phone. I can see the local image on emulator but on phone - 'Webpage not available'. However I can load othe
Solution 1:
Are you by any chance running the code on a phone with API Level < 8 (Android 2.1 and lower) and testing it on an emulator running a more recent version?
file:///android_res/...
only works for 2.2+.
Alternatively you can try putting the image in the assets folder and reference it by file:///android_asset/...
, which apparently is also supported on devices running older versions. Unfortunately you will lose the ability to automatically load up resources appropriate to the device's screen size and density.
Post a Comment for "Webview: Cannot Display Local Image On Phone But Displays On Emulator"