Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android PictureListener已弃用和过时,是否有替代品?_Android_Webview_Deprecated - Fatal编程技术网

Android PictureListener已弃用和过时,是否有替代品?

Android PictureListener已弃用和过时,是否有替代品?,android,webview,deprecated,Android,Webview,Deprecated,我希望在WebView上完全绘制图像时收到通知。使用是一个常见的答案(甚至由建议),但被列为不推荐和过时。有替代品吗?怎么样 webview.setWebViewClient(new WebViewClient(){ @Override public void onPageFinished(WebView view, String url) { // you can get the picture here super.onPageFinishe

我希望在WebView上完全绘制图像时收到通知。使用是一个常见的答案(甚至由建议),但被列为不推荐和过时。有替代品吗?

怎么样

webview.setWebViewClient(new WebViewClient(){

    @Override
    public void onPageFinished(WebView view, String url) {
        // you can get the picture here
        super.onPageFinished(view, url);

    }
});

我看到Android 4.0更新了文档:

此方法已弃用。由于内部的变化,图片没有显示 不包括合成层,例如固定位置元素或 可滚动的div。而PictureListener API仍然可以用于 检测WebView内容中的更改,建议您不要使用 直到在未来的Android版本中提供替换品为止


尚未更换。

谢谢Tamas,但当主帧加载完成,但渲染图片可能尚未更新时,onPageFinished会通知您。onPageFinished()有时在呈现web UI之前调用。这不是onLoadResource()的作用吗?也许我错了。如何重载它,调用super.onLoadResource(),然后检查文件类型?