Having an issue with my Android app that uses WebView and JavaScript. In the onPageFinished() method of my WebViewClient, I trigger a JavaScript initializing function. However, when I try to access window.innerWidth in the JavaScript method, it always returns incorrect values (320 x 240) regardless of orientation. This is strange because elsewhere in the script, window.innerWidth and window.innerHeight give accurate numbers.
What's more confusing is that if I directly check the height and width of the WebView in onPageFinished(), using view.getHeight() and view.getWidth(), it gives me the correct values. This indicates that everything has loaded properly in WebView.
Any insights on what might be causing this discrepancy?
Appreciate any help!