Webview Shows Blank Page When Opening Payment Sites - Lollipop
Solution 1:
Managed to figure this out. The thing about your site and the one I was struggling with is that they are trying to occupy full screen height. My webview (and I think yours as well) had layout_height="wrap_content", and although it had proper height because of positioning inside relative layout, when targeting sdk 21 webview was reporting 0 height to the page resulting all its elements collapse to 0 height as well. All you need to do is to change layout_height of the webview to match_parent.
Pro tip for developers struggling with webview rendering problems. Use webview remote debugging https://developer.chrome.com/devtools/docs/remote-debugging It can save a lot of time when dealing with problems like this.
Solution 2:
Here is a list of changes in webview for lolipop, maybe this helps.
Android 5.0 changes the default behavior for your app.
If your app targets API level 21 or higher: The system blocks mixed content and third party cookies by default. To allow mixed content and third party cookies, use the setMixedContentMode() and setAcceptThirdPartyCookies() methods respectively. The system now intelligently chooses portions of the HTML document to draw. This new default behavior helps to reduce memory footprint and increase performance. If you want to render the whole document at once, disable this optimization by calling enableSlowWholeDocumentDraw(). If your app targets API levels lower than 21: The system allows mixed content and third party cookies, and always renders the whole document at once.
Source: http://developer.android.com/about/versions/android-5.0-changes.html#BehaviorWebView
Post a Comment for "Webview Shows Blank Page When Opening Payment Sites - Lollipop"