views:

39

answers:

1

I am dynamically serving an image from my server, and attempting to display it in an img tag on an Android phone. This works perfectly in the normal Android browser, but when I try it in my app's Webview I just get a question mark.

Running Android 2.1.1 on a Nexus One

A: 

Your application need access permission to the web.

<uses-permission android:name="android.permission.INTERNET" />

http://developer.android.com/reference/android/webkit/WebView.html

darlinton
I have permission. I can load everything else from my server, including static images, the only things that aren't loading are the dynamically served images.
Veered
I believe the webview does not recognize the mimetype automatically of your dynamic image - because it does not have a extension.
darlinton
Try to load it by public void loadData (String data, String mimeType, String encoding) or wv.loadDataWithBaseURL("", html, mimeType, encoding, "") and change the DOM. It is a workaround.
darlinton
Ugh... is there any other way? I would really like to maintain portability as much as possible. How does the built-in browser do it?
Veered
darlinton