Commit 5b9a3242 authored by mengcuiguang2's avatar mengcuiguang2

webview退出后 清除缓存

parent b061a29c
...@@ -2,6 +2,7 @@ package com.mints.street.webview ...@@ -2,6 +2,7 @@ package com.mints.street.webview
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.ViewGroup
import android.webkit.WebSettings import android.webkit.WebSettings
import android.webkit.WebView import android.webkit.WebView
import android.webkit.WebViewClient import android.webkit.WebViewClient
...@@ -65,4 +66,16 @@ class MintsWebViewActivity : BaseActivity<ActivityMintsWebViewBinding, MintsWebV ...@@ -65,4 +66,16 @@ class MintsWebViewActivity : BaseActivity<ActivityMintsWebViewBinding, MintsWebV
} }
override fun onDestroy() {
super.onDestroy()
binding.webview?.let {
it.destroyDrawingCache()
val parent = it.parent as ViewGroup
parent?.removeView(it)
it.removeAllViews()
it.destroy()
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment