Android Webview: Page Discovery

I am writing a highbred Android application that uses a lot of web views. The problem is that the onPageFinished event for web browsing is fired when the page loads, but cannot yet be displayed.

I believe that was onNewPicture, but was removed from version 12.

Someone encounters the same problem, my counter basically disappears about 3-4 seconds before the page actually displays.

+1
source share
1 answer

WebView rendering can take a long time for long documents, and indeed, onNewPicture is deprecated with API 12 (Honeycomb 3.1) and returns a null image from API level 18 (Jellybean 4.3).

I tested for API level 17 (JB 4.2) and it still works fine. It probably works fine in API 18 too if you don't need the actual Picture data.

Please check the issue with the issue tracker so that we can get a non-obsolete replacement.

 if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR1) { PictureListener pictureListener = new PictureListener() { @Override @Deprecated public void onNewPicture(WebView view, Picture picture) { Log.i(TAG, "Picture changed!"); } }; webView.setPictureListener(pictureListener); } 
0
source

Source: https://habr.com/ru/post/971862/


All Articles