Android Webview.scrollTo not updating (Java)

Viewed 22

My problem is, that only after testScroll() is done the calls for the scrollTo() function are applied, which results in one large jump.

Therefore, I'm unable to create bitmaps of different regions that would lie next to each other. I'm kinda clueless how to approach this issue?

What I tried so far:

I tried to interlace it in other functions in hopes of triggering it.

Sadly, scrollTo() will only trigger after all man made control structures are done.

I tried following the documentation, but there is no source code and there is nothing meaningful written there.

I tried to follow it in debug mode, but that didn't bear any fruits, be course you are limited how far you can follow along.

public void testScroll(View view){
        WebView webView = findViewById(R.id.webViewMain);
        int xValue = webView.getScrollX();
        int yValue = webView.getScrollY();
        int scrollValue = webView.getHeight();
        
        for(int i=0;i<10;i++){
            yValue += scrollValue;
            makeBitmapOfScreen();
            webView.scrollTo(xValue, yValue); 
        }

    }
0 Answers
Related