We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3186209 commit bf4d4ebCopy full SHA for bf4d4eb
1 file changed
app/src/main/kotlin/com/njlabs/showjava/utils/Ads.kt
@@ -19,6 +19,7 @@
19
package com.njlabs.showjava.utils
20
21
import android.annotation.SuppressLint
22
+import android.app.Activity
23
import android.content.Context
24
import android.content.Intent
25
import android.content.SharedPreferences
@@ -68,7 +69,9 @@ class Ads(val context: Context) {
68
69
consentForm = ConsentForm.Builder(context, URL(context.getString(R.string.privacyPolicyUrl)))
70
.withListener(object : ConsentFormListener() {
71
override fun onConsentFormLoaded() {
- consentForm.show()
72
+ if (context is Activity && !context.isFinishing) {
73
+ consentForm.show()
74
+ }
75
}
76
77
override fun onConsentFormOpened() {
0 commit comments