Skip to content Skip to sidebar Skip to footer

Android App Closes Without Any Error-webview Javascript

I have a webview with HTML webpage which is downloaded from server and i populate dynamic data and add rows of information to this webpage. I have used the following code on that w

Solution 1:

I think you need to use loadDataWithBaseURL again instead of just loadUrl.

See this link. There is a section explaining loadData that says:

Note that JavaScript's same origin policy means that script running in a page loaded using this method will be unable to access content loaded using any scheme other than 'data', including 'http(s)'. To avoid this restriction, use loadDataWithBaseURL() with an appropriate base URL.

Solution 2:

FINALLY!! fixed it.. the adapter was holding previously downloaded images as well as the images downloaded during second click and i don't understand why the application was closing without giving any memory leaks as well.. anyways its working fine now after using

adapter.clear();

or re-initializing the adapter to null after all the image thumbs are downloaded(i do not know if this is very efficient). After the adapter is cleared, use

adapter.notifyDataSetChanged();

Post a Comment for "Android App Closes Without Any Error-webview Javascript"