I saw another SO question on this, and it was not resolved.
I am using LoadData () with the html application created.
I noticed when I add a few empty lines after the new text, the page scrolls and the text appears magically for a moment (without scrolling, it just appears as when fading.).
The .getContentHeight () view is not updated in the onPageFinshed () event, but it is updated the next time text is added to the page.
I created a timer event to watch getContentHeight. Even after I discovered that getContentHeight had changed and released the browser .pageDown (true), the page still ran when scrolling down.
It seems to work fine the first time you enter the game. My problem only occurs when adding a few lines to newInnerHTML.
In addition, the view in question has a header and footer with a browser in the middle. WebView is NOT located behind the footer.
Is this a mistake, or am I missing something?
Tia, Jim
this code is inside onCreate for activity.
final WebView browser = (WebView) findViewById(R.id.webview);
browser.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(browser, url);
Log.d(TAG,"page getContentHeight: " + browser.getContentHeight());
Log.d(TAG,"page finished");
browser.pageDown(true);
}
});
This method after onCreate operation for activity
private void UpdateMessageDisplay () {
browser.loadData("<html><body>" + newInnerHTML + "</body></html>", "text/html", "utf-8");
browser.reload();
}