Issue
SOLVED: Problem was that the second picture was really large!
I am a bit confused about this... probably I am missing something really basic.
I am trying to display this simple html page as part of my UI (there's lots of elements in there, not just the webview)
<html>
<head>
</head>
<body bgcolor="black">
<div align="center">
<h2>Blabla</h2>
<p>
<img src="images/image1.jpg" width="300" />
</p>
<p>
<img src="images/image2.jpg" width="300" />
</p>
<h3>tralala</h3>
</div>
</body>
</html>
This is how I try to display the content (the url is a real url, not an asset!):
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("url");
This is the relevant part of the main.xml file:
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
What happens is that it loads the first image plus the text blabla, but not the tralala and the second image. It's like it stops loading. How can I fix this?
Thanks for your help.
Solution
image2.jpg was really huge and that seemed to cause the problem. Person responsible for html site now resized the picture and it is working fine now.
Answered By - taranaki
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.