替换Android默认的Webview [英] Replace Android default webview

查看:1650
本文介绍了替换Android默认的Webview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现自己的Webview并用我的实现替换Android默认的Webview(我的意思是所有使用Webview小部件的应用程序都将通过我的实现呈现).有没有办法做到这一点?我想听听您的建议.

I want to implement my own webview and replace Android default webview with my implementation (i mean that all applications which uses webview widget will be rendered using my implementation). Is there a way to do that? I would like to hear your advice.

推荐答案

在您自己的AOSP Marshmallow和Lollipop中构建的Android中,您可以在frameworks/base/core/res/res/values/config.xml中更改config_webViewPackageName变量的值(

In your own build of Android from AOSP Marshmallow and Lollipop, you can change the value of config_webViewPackageName variable in frameworks/base/core/res/res/values/config.xml (source) to point to your WebView implementation package.

请注意,尽管WebView自带apk,但它仍然是框架的一部分,因此不能用现有设备上的其他某些实现代替.类似于询问如何替换默认的TextView".

Note that despite the fact that WebView comes in its own apk, it is still part of the framework, so it can't be replaced with some other implementation on existing devices. It's similar to asking "how can I replace the default TextView".

这篇关于替换Android默认的Webview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆