From 617083f48fc003e5d9a490e3c76e1020451e1ec5 Mon Sep 17 00:00:00 2001 From: Abdul Mannan Saeed <111820160@umt.edu.pk> Date: Sun, 5 Feb 2023 01:04:10 +0500 Subject: [PATCH] Bug Fixes Bug Fixes --- .../adPluginManager/appLovinManager.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java index 3b6c7cba..5bead076 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java +++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java @@ -13,6 +13,7 @@ public class appLovinManager { private eventObserver.eventListener mEvent; private applovinSupportManager mSupportManager; private applovinBannerManager mBannerManager; + private AppCompatActivity mContext; private boolean mLowMemoryReached = false; @@ -20,6 +21,8 @@ public class appLovinManager { public appLovinManager(eventObserver.eventListener pEvent, View pBannerAds, AppCompatActivity pContext) { this.mEvent = pEvent; + this.mContext = pContext; + onInitializeAdvertisement(pContext); } @@ -37,11 +40,15 @@ public class appLovinManager { /*Local Helper Methods*/ private void onShowInterstitial() { - this.mSupportManager.onShow(); + if(AppLovinSdk.getInstance(mContext).isInitialized()){ + this.mSupportManager.onShow(); + } } private void onToggleBannerShow(boolean pStatus) { - this.mBannerManager.onShow(pStatus); + if(AppLovinSdk.getInstance(mContext).isInitialized()){ + this.mBannerManager.onShow(pStatus); + } } /*Helper Methods*/