Android 抛弃原生WebView,使用腾讯X5内核、并加入广告拦截

Android 抛弃原生WebView,使用腾讯X5内核、并加入广告拦截。

最近在使用,总会出现DNS被拦截的情况。预览了各个大神的论坛与博客。

发现可以更改WebView内核。找到了比较火的两个。

 

分别是:腾讯X5内核 和 crosswalk  

     crosswalk : 据说很强大,但缺点就是会让你的APK包增大很多。(我还没试过,都是看大神们的博客说的)

     大家可以参考这篇文章 如何轻松搞定Crosswalk之嵌入模式

    相对crosswalk呢,腾讯X5 比较适合我目前的项目。至少包不会一下子给我 增大那么多  

     TBS腾讯浏览服务(点击跳转官网)

 

    

 

  腾讯X5的好处我就不再说了,官网解释的肯定比我到位,我怎么做的吧。

 

第一步:那肯定是下载官方的SDK 包啦(腾讯浏览服务-SDK下载) 我这里下载的是上面这个

 

第二步:根据SDK 提供的jar包和so 包拷贝到自己的项目下。

    (注意:我这里和官方提供的so,放的位置可能有点区别,这个就需要看的项目情况了)

    

注意:x5暂时不提供64位so文件,为了保证64位手机能正常加载x5内核,请参照如下链接修改相关配置

https://x5.tencent.com/tbs/technical.html#/detail/sdk/1/34cf1488-7dc2-41ca-a77f-0014112bcab7

 

官方的Demo ,so包是放在 src\main\jniLibs  下这个可以看一下官方包。就知道了

在Demo 中的build.gradle,中有说到 so 包的目录位置

 

 

第三步:接下来就开始被配置,初始化X5了,在APP的 Application 中 onCreate()  去初始化

 


 
 
  1. private void initX5() {
  2. QbSdk.setDownloadWithoutWifi( true);
  3. //x5内核初始化接口//搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。
  4. QbSdk.initX5Environment(getApplicationContext(), new QbSdk.PreInitCallback() {
  5. @Override
  6. public void onViewInitFinished(boolean arg0) {
  7. //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
  8. Log.d( "app", " onViewInitFinished is " + arg0);
  9. }
  10. @Override
  11. public void onCoreInitFinished() {
  12. }
  13. });
  14. }

在清单文件中去添加


 
 
  1. <!-- 腾讯X5内核初始化 -->
  2. <service android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
  3. android:label= "dexopt"
  4. android:process= ":dexopt" />

 

第四步 :继承  com.tencent.smtt.sdk.WebView  自定义 WebView (这里根据自己的情况定义)

 


 
 
  1. public class SimpleWebView extends com.tencent.smtt.sdk.WebView {
  2. public SimpleWebView(Context context) {
  3. super(context);
  4. init();
  5. }
  6. public SimpleWebView(Context context, AttributeSet attrs) {
  7. super(context, attrs);
  8. init();
  9. }
  10. public SimpleWebView(Context context, AttributeSet attrs, int defStyleAttr) {
  11. super(context, attrs, defStyleAttr);
  12. init();
  13. }
  14. @SuppressLint( "SetJavaScriptEnabled")
  15. private void init() {
  16. WebSettings webSetting = this.getSettings();
  17. webSetting.setJavaScriptEnabled( true);
  18. webSetting.setJavaScriptCanOpenWindowsAutomatically( true);
  19. webSetting.setAllowFileAccess( true);
  20. webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
  21. webSetting.setSupportZoom( true);
  22. webSetting.setBuiltInZoomControls( true);
  23. webSetting.setUseWideViewPort( true);
  24. webSetting.setSupportMultipleWindows( true);
  25. // webSetting.setLoadWithOverviewMode(true);
  26. webSetting.setAppCacheEnabled( true);
  27. // webSetting.setDatabaseEnabled(true);
  28. webSetting.setDomStorageEnabled( true);
  29. webSetting.setGeolocationEnabled( true);
  30. webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
  31. // webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);
  32. webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
  33. // webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH);
  34. webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
  35. this.setWebViewClient( new SimpleWebViewClient());
  36. this.setWebChromeClient( new WebChromeClient(){
  37. //这里可以设置进度条。但我是用另外一种
  38. @Override
  39. public void onProgressChanged(WebView webView, int i) {
  40. super.onProgressChanged(webView, i);
  41. }
  42. });
  43. }
  44. public static class SimpleWebViewClient extends com.tencent.smtt.sdk.WebViewClient {
  45. private SimpleLoadingDialog loadingDialog;
  46. @Override
  47. public com.tencent.smtt.export.external.interfaces. WebResourceResponse shouldInterceptRequest(com.tencent.smtt.sdk.WebView webView, String url) {
  48. //做广告拦截,ADFIlterTool 为广告拦截工具类
  49. if (!ADFilterTool.hasAd(webView.getContext(),url)){
  50. return super.shouldInterceptRequest(webView, url);
  51. } else {
  52. return new WebResourceResponse( null, null, null);
  53. }
  54. }
  55. /**
  56. * 防止加载网页时调起系统浏览器
  57. */
  58. @Override
  59. public boolean shouldOverrideUrlLoading(com.tencent.smtt.sdk.WebView webView, String url) {
  60. webView.loadUrl(url);
  61. return true;
  62. }
  63. //在开始的时候,开始loadingDialog
  64. @Override
  65. public void onPageStarted(com.tencent.smtt.sdk.WebView webView, String s, Bitmap bitmap) {
  66. super.onPageStarted(webView, s, bitmap);
  67. try{
  68. loadingDialog = new SimpleLoadingDialog(webView.getContext(), true);
  69. loadingDialog.show();
  70. } catch (Exception e){}
  71. }
  72. //在页面加载结束的时候,关闭LoadingDialog
  73. @Override
  74. public void onPageFinished(com.tencent.smtt.sdk.WebView webView, String s) {
  75. super.onPageFinished(webView, s);
  76. try {
  77. if (loadingDialog != null) {
  78. loadingDialog.dismiss();
  79. }
  80. } catch (Exception e) {}
  81. }
  82. @Override
  83. public void onReceivedError(com.tencent.smtt.sdk.WebView webView, com.tencent.smtt.export.external.interfaces.WebResourceRequest webResourceRequest, com.tencent.smtt.export.external.interfaces.WebResourceError webResourceError) {
  84. super.onReceivedError(webView, webResourceRequest, webResourceError);
  85. }
  86. @Override
  87. public void onReceivedSslError(com.tencent.smtt.sdk.WebView webView, com.tencent.smtt.export.external.interfaces.SslErrorHandler sslErrorHandler, com.tencent.smtt.export.external.interfaces.SslError sslError) {
  88. sslErrorHandler.proceed();
  89. }
  90. }
  91. }

 

 

 

接下来就是使用了,和我们原生的webView 没什么区别啦。

 


 
 
  1. /**
  2. * 初始化webView
  3. */
  4. @SuppressLint( "SetJavaScriptEnabled")
  5. private void initDetailsH5() {
  6. webView.getSettings().setJavaScriptEnabled( true);
  7. webView.setWebViewClient( new SimpleWebView.SimpleWebViewClient(){
  8. @Override
  9. public void onPageFinished(com.tencent.smtt.sdk.WebView webView, String url) {
  10. super.onPageFinished(webView, url);
  11. toolbarTitle.setText(webView.getTitle()); //获取WebView 的标题,设置到toolbar中去
  12. }
  13. @Override
  14. public boolean shouldOverrideUrlLoading(com.tencent.smtt.sdk.WebView webView, String url) {
  15. if (url.contains( "Activity/")){
  16. ...
  17. } else if (url.contains( "Share")){
  18. ...
  19. } else {
  20. webView.loadUrl(url);
  21. }
  22. return true;
  23. }
  24. });
  25. }

 


 
 
  1. /**
  2. * 监听系统返回键,判断WebView是否有上一级,有的话就返回WebView的上一级
  3. * 否则返回页面
  4. *
  5. * @param keyCode
  6. * @param event
  7. * @return
  8. */
  9. @Override
  10. public boolean onKeyDown(int keyCode, KeyEvent event) {
  11. if (keyCode == KeyEvent.KEYCODE_BACK) {
  12. if (webView != null && webView.canGoBack()) {
  13. webView.goBack();
  14. return true;
  15. } else {
  16. return super.onKeyDown(keyCode, event);
  17. }
  18. }
  19. return super.onKeyDown(keyCode, event);
  20. }

 

 

 

第五步:这里也根据需要添加吧。就是广告拦截了。广告库加多了的话,可能就会影响性能了。

            (我觉的这种做法存在很大的问题,如果建议直接使用Https。就可以避免这个问题)


 
 
  1. public class ADFilterTool {
  2. /**
  3. * 屏蔽广告的NoAdWebViewClient类
  4. *
  5. * @param context
  6. * @param url
  7. * @return true 为广告链接,false 为正常连接
  8. */
  9. public static boolean hasAd(Context context, String url) {
  10. Resources res = context.getResources();
  11. String[] adUrls = res.getStringArray(R.array.adBlockUrl);
  12. for (String adUrl : adUrls) {
  13. if (url.contains(adUrl)) {
  14. return true;
  15. }
  16. }
  17. return false;
  18. }
  19. }

 

在 res \ vlaues 目录下创建 AdUrlString.xml

 

 

(注:广告库部分摘取 Android Webview广告过滤的实现


 
 
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
  3. <string-array name="adBlockUrl">
  4. <item>ubmcmm.baidustatic.com </item>
  5. <item>gss1.bdstatic.com/ </item>
  6. <item>cpro2.baidustatic.com </item>
  7. <item>cpro.baidustatic.com </item>
  8. <item>lianmeng.360.cn </item>
  9. <item>nsclick.baidu.com </item>
  10. <item>caclick.baidu.com/ </item>
  11. <item>jieaogd.com </item>
  12. <item>publish-pic-cpu.baidu.com/ </item>
  13. <item>cpro.baidustatic.com/ </item>
  14. <item>hao61.net/ </item>
  15. <item>cpu.baidu.com/ </item>
  16. <item>pos.baidu.com </item>
  17. <item>cbjs.baidu.com </item>
  18. <item>cpro.baidu.com </item>
  19. <item>images.sohu.com/cs/jsfile/js/c.js </item>
  20. <item>union.sogou.com/ </item>
  21. <item>sogou.com/ </item>
  22. <item>5txs.cn/ </item>
  23. <item>liuzhi520.com/ </item>
  24. <item>yhzm.cc/ </item>
  25. <item>jieaogd.com </item>
  26. <item>a.baidu.com </item>
  27. <item>c.baidu.com </item>
  28. <item>mlnbike.com </item>
  29. <item>alipays://platformapi </item>
  30. <item>alipay.com/ </item>
  31. <item>jieaogd.com </item>
  32. <item>vipshop.com </item>
  33. </string-array>
  34. </resources>

 

接下来就是  CookieUtils  ,同步WebView 的Cookie。为什么要同步Cookie ,我这就不介绍啦。

直接贴代码


 
 
  1. /**
  2. * Created by Peng on 2017/7/31.
  3. */
  4. public class CookieUtils {
  5. /**s
  6. * 安卓登陆与H5同步Cookie
  7. *
  8. * @param mUrl
  9. */
  10. public static void syncSession(Context context,WebView webView, String mUrl){
  11. HttpUrl httpUrl = HttpUrl.parse(mUrl);
  12. if (httpUrl != null){
  13. //注入session
  14. CookieManager cm = CookieManager.getInstance();
  15. cm.setAcceptCookie( true);
  16. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  17. cm.removeSessionCookies( new ValueCallback<Boolean>() {
  18. @Override
  19. public void onReceiveValue(Boolean value) {
  20. }
  21. });
  22. } else {
  23. cm.removeSessionCookie();
  24. }
  25. cm.removeAllCookie();
  26. JavaNetCookieJar cookieJar = (JavaNetCookieJar) RetrofitUtil.getOkHttpClient().cookieJar();
  27. List<Cookie> cookies = cookieJar.loadForRequest(httpUrl);
  28. for (Cookie cookie : cookies) {
  29. cm.setCookie(mUrl, cookie.toString());
  30. }
  31. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  32. cm.setAcceptThirdPartyCookies(webView, true);
  33. CookieManager.getInstance().flush();
  34. } else {
  35. CookieSyncManager.createInstance(context).sync();
  36. }
  37. }
  38. }
  39. /**s
  40. * 安卓登陆与H5同步Cookie X5内核同步
  41. *
  42. * @param mUrl
  43. */
  44. public static void syncSession(Context context, com.tencent.smtt.sdk.WebView webView, String mUrl){
  45. HttpUrl httpUrl = HttpUrl.parse(mUrl);
  46. if (httpUrl != null){
  47. //注入session
  48. com.tencent.smtt.sdk.CookieManager cm = com.tencent.smtt.sdk.CookieManager.getInstance();
  49. cm.setAcceptCookie( true);
  50. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  51. cm.removeSessionCookies( new com.tencent.smtt.sdk.ValueCallback<Boolean>() {
  52. @Override
  53. public void onReceiveValue(Boolean value) {
  54. }
  55. });
  56. } else {
  57. cm.removeSessionCookie();
  58. }
  59. cm.removeAllCookie();
  60. JavaNetCookieJar cookieJar = (JavaNetCookieJar) RetrofitUtil.getOkHttpClient().cookieJar();
  61. List<Cookie> cookies = cookieJar.loadForRequest(httpUrl);
  62. for (Cookie cookie : cookies) {
  63. cm.setCookie(mUrl, cookie.toString());
  64. }
  65. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  66. cm.setAcceptThirdPartyCookies(webView, true);
  67. CookieManager.getInstance().flush();
  68. } else {
  69. CookieSyncManager.createInstance(context).sync();
  70. }
  71. }
  72. }
  73. /**
  74. * 同步token
  75. *
  76. * @param context
  77. * @param url
  78. * @param token
  79. */
  80. public static void syncCookie(Context context, String url,String token){
  81. clearCookie(context);
  82. try{
  83. CookieSyncManager.createInstance(context);
  84. CookieManager cookieManager = CookieManager.getInstance();
  85. cookieManager.setAcceptCookie( true);
  86. cookieManager.removeSessionCookie(); // 移除
  87. cookieManager.removeAllCookie();
  88. String cookieValue = "token=" + token;
  89. cookieManager.setCookie(url, cookieValue);
  90. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  91. CookieManager.getInstance().flush();
  92. } else {
  93. CookieSyncManager.createInstance(context).sync();
  94. }
  95. } catch(Exception e){
  96. }
  97. }
  98. /**
  99. * 同步X5 token
  100. *
  101. * @param context
  102. * @param url
  103. * @param token
  104. */
  105. public static void syncX5Cookie(Context context, String url,String token){
  106. clearX5Cookie(context);
  107. try{
  108. com.tencent.smtt.sdk.CookieSyncManager.createInstance(context);
  109. com.tencent.smtt.sdk.CookieManager cookieManager = com.tencent.smtt.sdk.CookieManager.getInstance();
  110. cookieManager.setAcceptCookie( true);
  111. cookieManager.removeSessionCookie(); // 移除
  112. cookieManager.removeAllCookie();
  113. String cookieValue = "token=" + token;
  114. cookieManager.setCookie(url, cookieValue);
  115. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  116. com.tencent.smtt.sdk.CookieManager.getInstance().flush();
  117. } else {
  118. com.tencent.smtt.sdk.CookieSyncManager.createInstance(context).sync();
  119. }
  120. } catch(Exception e){
  121. }
  122. }
  123. /**
  124. * 清除WebView 缓存以及Cookie
  125. *
  126. * @param context
  127. * @param webView
  128. */
  129. public static void clearWebViewCache(Context context, WebView webView){
  130. clearCookie(context);
  131. webView.setWebChromeClient( null);
  132. webView.setWebViewClient( null);
  133. webView.getSettings().setJavaScriptEnabled( false);
  134. webView.clearCache( true);
  135. }
  136. /**
  137. * 清除X5WebView 缓存以及Cookie
  138. *
  139. * @param context
  140. * @param webView
  141. */
  142. public static void clearWebViewCache(Context context, com.tencent.smtt.sdk.WebView webView){
  143. clearX5Cookie(context);
  144. webView.setWebChromeClient( null);
  145. webView.setWebViewClient( null);
  146. webView.getSettings().setJavaScriptEnabled( false);
  147. webView.clearCache( true);
  148. }
  149. /**
  150. * 清除Cookie
  151. *
  152. * @param context
  153. */
  154. public static void clearCookie(Context context){
  155. CookieSyncManager.createInstance(context); //Create a singleton CookieSyncManager within a context
  156. CookieManager cookieManager = CookieManager.getInstance(); // the singleton CookieManager instance
  157. cookieManager.removeAllCookie(); // Removes all cookies.
  158. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // forces sync manager to sync now
  159. CookieManager.getInstance().flush();
  160. } else {
  161. CookieSyncManager.createInstance(context);
  162. CookieSyncManager.getInstance().sync();
  163. }
  164. }
  165. /**
  166. * 清除X5Cookie
  167. *
  168. * @param context
  169. */
  170. public static void clearX5Cookie(Context context){
  171. com.tencent.smtt.sdk.CookieSyncManager.createInstance(context); //Create a singleton CookieSyncManager within a context
  172. com.tencent.smtt.sdk.CookieManager cookieManager = com.tencent.smtt.sdk.CookieManager.getInstance(); // the singleton CookieManager instance
  173. cookieManager.removeAllCookie(); // Removes all cookies.
  174. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // forces sync manager to sync now
  175. com.tencent.smtt.sdk.CookieManager.getInstance().flush();
  176. } else {
  177. com.tencent.smtt.sdk.CookieSyncManager.createInstance(context);
  178. com.tencent.smtt.sdk.CookieSyncManager.getInstance().sync();
  179. }
  180. }
  181. /**
  182. * 停止原生WebView加载,销毁WebView
  183. *
  184. * @param webView
  185. */
  186. public static void destroyWebView(WebView webView){
  187. if (webView != null){
  188. ViewParent parent = webView.getParent();
  189. if (parent != null) {
  190. ((ViewGroup) parent).removeView(webView);
  191. }
  192. webView.stopLoading();
  193. webView.clearHistory();
  194. webView.clearView();
  195. webView.removeAllViews();
  196. webView.destroy();
  197. webView = null;
  198. }
  199. }
  200. /**
  201. * 停止X5WebView加载,销毁WebView
  202. *
  203. * @param webView
  204. */
  205. public static void destroyWebView(com.tencent.smtt.sdk.WebView webView){
  206. if (webView != null){
  207. ViewParent parent = webView.getParent();
  208. if (parent != null) {
  209. ((ViewGroup) parent).removeView(webView);
  210. }
  211. webView.stopLoading();
  212. webView.clearHistory();
  213. webView.clearView();
  214. webView.removeAllViews();
  215. webView.destroy();
  216. webView = null;
  217. }
  218. }
  219. }

最后温馨提醒一下,如果没有添加权限,注意加一下权限噢~


 
 
  1. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  2. <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  3. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  4. <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  5. <uses-permission android:name="android.permission.READ_SETTINGS" />
  6. <uses-permission android:name="android.permission.WRITE_SETTINGS" />
  7. <uses-permission android:name="android.permission.INTERNET" />
  8. <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
  9. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  10. <!-- 硬件加速对X5视频播放非常重要,建议开启 -->
  11. <uses-permission android:name="android.permission.GET_TASKS" />

 

第六步:如果需要做适配兼容的需要配置以下配置

兼容视频播放:

1)享受页面视频的完整播放体验需要做如下声明:

页面的Activity需要声明 android:configChanges="orientation|screenSize|keyboardHidden"
 
 

2)视频为了避免闪屏和透明问题,需要如下设置

a)网页中的视频,上屏幕的时候,可能出现闪烁的情况,需要如下设置:Activity在onCreate时需要设置:

getWindow().setFormat(PixelFormat.TRANSLUCENT);//(这个对宿主没什么影响,建议声明)
 
 

b)在非硬绘手机和声明需要controller的网页上,视频切换全屏和全屏切换回页面内会出现视频窗口透明问题,需要如下设置


 
 
  1. 声明当前 <item name="android:windowIsTranslucent">false </item>为不透明。
  2. 特别说明:这个视各app情况所需,不强制需求,如果声明了,对体验更有利

c)以下接口禁止(直接或反射)调用,避免视频画面无法显示:


 
 
  1. webview.setLayerType()
  2. webview.setDrawingCacheEnabled( true);

 

第七步:输入法设置

避免输入法界面弹出后遮挡输入光标的问题

方法一:在AndroidManifest.xml中设置

android:windowSoftInputMode="stateHidden|adjustResize"
 
 

方法二:在代码中动态设置:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
 
 

 

还有一些其他的配置信息 我这里就不在搬官方的介绍了。

混淆配置、APP自定义UA、Tbs视频播放器接入...等等。官方描述还是很清晰的

 

好啦,到这里就全部介绍完啦。希望对你帮助。

 

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
腾讯X5内核是一款支持多进程、支持硬件加速、支持自定义内核扩展的WebView内核。在Android开发中,使用腾讯X5内核可以提高WebView的性能和稳定性,下面是一些优化和实践总结: 1. 引入腾讯X5内核 引入腾讯X5内核需要在项目中添加相应的依赖库,然后在代码中进行初始化和使用。具体步骤可以参考腾讯官方文档。 2. 启用硬件加速 在使用腾讯X5内核时,可以启用硬件加速来提高WebView的渲染速度。具体可以通过设置WebView的LayerType属性来实现,例如: ``` webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); ``` 3. 使用预加载 预加载可以在用户点击链接之前就开始加载下一页的内容,以提高用户体验和减少页面加载时间。腾讯X5内核提供了预加载功能,可以通过设置WebView的预加载模式来实现,例如: ``` webView.getX5WebViewExtension().setPageCacheCapacity(5); // 设置最大缓存页面数为5 webView.getX5WebViewExtension().setPreload(true); // 开启预加载模式 ``` 4. 优化JSBridge通信 JSBridge是一种用于WebView和Native代码之间通信的技术,但是在使用过程中容易出现性能问题。为了优化JSBridge通信,可以使用腾讯X5内核提供的基于V8引擎的JSBridge,它可以提高通信效率和稳定性。 5. 避免WebView内存泄漏 在使用WebView时,需要注意避免内存泄漏问题。具体可以通过以下方式来避免: - 及时释放WebView对象 - 使用静态内部类或弱引用来持有WebView对象 - 在Activity的onDestroy()方法中调用WebView的destroy()方法 总之,腾讯X5内核是一款非常强大的WebView内核,可以帮助我们优化WebView的性能和稳定性。在使用中,需要注意以上几点优化和实践。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值