开发者

Application error while displaying images inside Webview

I am creating an android app which displays all the images for a particular user.

I am currently preparing a string on my server (which is actually html code generated dynamically) and then returning this string to my android app. Then the app loads this retrieved string into the Webview. (This string actually contains开发者_运维知识库 the absolute urls for the images)

However, for the first couple of times when the app starts and tries to load the images, it actually crashes. Afterwards, it loads the images faster and doesn't crash. I don't understand why this happens? Can anybody explain me the reason for the same.

Also, what it the best way to display a list of images (somewhat gridview type ) in an android app?

Logcat details when the crash happens:

04-26 10:30:09.972: INFO/System.out(4265): onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=http://myworkingurl.com

Thanks in advance.


I think the problem may be in your mobile's network as it is too slow to get some url.
May be this code can help you

super.setIntegerProperty("loadUrlTimeoutValue", 50000);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜