Hi,
I display a local webpage (located in my 'assets' directory) within a
Webview. The webpage is almost exclusively text.
When displayed, the middle third of the body of text appears to be
repeated multiple times, and makes the text appear very cluttered.
I ran the webpage through the W3C html validator and it passed without
any errors.
Displaying it on regular browsers work perfectly.
Here's my code:
setContentView(R.layout.signpost);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.setBackgroundColor(0); // make the background transparent
mWebView.setBackgroundResource(R.drawable.background);
InputStreamReader is = null;
try {
is = new
InputStreamReader(getApplicationContext().getAssets().open("signPostContent.html"));
BufferedReader buff = new BufferedReader(is, 8192);
StringBuffer out = new StringBuffer();
String strLine = null;
while ((strLine = buff.readLine()) != null) {
out.append(strLine);
}
is.close();
String mimeType = "text/html";
String encoding = "utf-8";
String fin = new String(out.toString());
mWebView.loadDataWithBaseURL("file:///sdcard/data/data/
com.this.that/", fin, mimeType, encoding, "");
} catch (IOException e) {
e.printStackTrace();
}
Any ideas?
jb
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en