Commit 934ec803 authored by wanglei's avatar wanglei

...

parent d1034bae
...@@ -31,7 +31,7 @@ object AdmobNativeUtils { ...@@ -31,7 +31,7 @@ object AdmobNativeUtils {
private val mRequest = AdRequest.Builder().build() private val mRequest = AdRequest.Builder().build()
var onAdLoaded: (() -> Unit)? = null var onAdLoaded: (() -> Unit)? = null
fun loadNativeAd() { fun loadNativeAd() {
if (nativeAd != null) { if (nativeAd != null) {
return return
} }
...@@ -141,4 +141,9 @@ object AdmobNativeUtils { ...@@ -141,4 +141,9 @@ object AdmobNativeUtils {
} }
} }
fun onDestroy() {
nativeAd?.destroy()
nativeAd = null
}
} }
\ No newline at end of file
...@@ -71,6 +71,7 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() { ...@@ -71,6 +71,7 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
binding.mDocView.onDestroy() binding.mDocView.onDestroy()
AdmobNativeUtils.onDestroy()
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
......
...@@ -85,6 +85,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -85,6 +85,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
muPDFCore?.onDestroy() muPDFCore?.onDestroy()
AdmobNativeUtils.onDestroy()
} }
override fun initView() { override fun initView() {
......
...@@ -87,6 +87,7 @@ class PptActivity : BaseActivity<ActivityPptBinding>() { ...@@ -87,6 +87,7 @@ class PptActivity : BaseActivity<ActivityPptBinding>() {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
binding.mDocView.onDestroy() binding.mDocView.onDestroy()
AdmobNativeUtils.onDestroy()
} }
override fun initListener() { override fun initListener() {
......
...@@ -344,6 +344,7 @@ class WordActivity : BaseActivity<ActivityWordBinding>() { ...@@ -344,6 +344,7 @@ class WordActivity : BaseActivity<ActivityWordBinding>() {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
binding.mDocView.onDestroy() binding.mDocView.onDestroy()
AdmobNativeUtils.onDestroy()
} }
} }
\ 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