Android Question WebViewExtras: pageDown-Methode

Discussion in 'Android Questions' started by Andie, Jul 6, 2015.

  1. Andie

    Andie Member Licensed User

    Hi, with the help of the WebViewExtras library one is able to scroll down a website, which is displayed in a WebView: (WebViewExtras1 and WebView1 are instances of WebViewExtras und WebView respectively)
    Code:
    WebViewExtras1.pageDown(WebView1, true)
    This works fine, assuming that the LoadUrl()-method was applied on the WebView. But one can also apply the LoadHtml()-method. For example:
    Code:
    WebView1.LoadHtml("<html><body>text ... and much, much more ... text</body></html>")
    But using the pageDown()-method then, doesn't show any effect. Has anyone an explanation for it? May be some tag is missing in the html-Text?
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    I guess, that webview1.loadHtml is an asynchronous task and pageDown will be executed before the page finished loading. one solution is may be to run the pagedown delayed. But I haven't tried this...
     
  3. Andie

    Andie Member Licensed User

    You are absolutely right and I took care of it by using:
    Code:
    WebView1_PageFinished (Url As String)
    WebViewExtras1.pageDown(WebView1, 
    true)
    End Sub
    However, as you see, I left the argument of this PageFinished-event i. e. (Url as String) unchanged, because I don't know what argument I could use instead.
     
  4. eurojam

    eurojam Well-Known Member Licensed User

  5. Andie

    Andie Member Licensed User

    If think there's no need to work with a delay, because the PageFinished-event works perfectly.
    I'm still wondering why in the case of:
    Code:
    WebView1.LoadUrl("http://www.b4x.com")
    the pageDown-method works fine, while in the case of:
    Code:
    WebView1.LoadUrl("file://" & File.DirInternal & "/test.htm")
    it does not.
     
    Last edited: Jul 6, 2015
Loading...